Calling dev_set_name with a single paramter causes it to be handled as a
format string. Many callers are passing potentially dynamic string
content, so use "%s" in those cases to avoid any potential accidents,
including wrappers like device_create*() and bdi_register().
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Added EXPORT_SYMBOL_GPL() for extcon_register_interest and
extcon_register_notifier in order to avoid undefined reference
error when building the consumer modules of extcon as _modules_.
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Lokesh Vutla <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Signed-off-by: Myungjoo Ham <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch change permission from read/write to only read.
The specific process in the user-space couldn't change the state
of cable when cable is attached or detached.
- /sys/class/extcon/[devine name]/state
Signed-off-by: Chanwoo Choi <[email protected]>
Signed-off-by: Myungjoo Ham <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Return the value obtained from the function extcon_register_interest
instead of -ENODEV.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Signed-off-by: Myungjoo Ham <[email protected]>
There are some scnearios where a driver/framework needs to register
interest for a particular cable without specifying the extcon device
name. One such scenario is charger notifications. The platform will
have charger cabel which will be bound to any extcon device. It's
not mandatory for the charger driver to know which extcon device
it should use. This patch enables the support for registering
interest for a cable just by cable name wihtout specifying the
extcon device name
Signed-off-by: Jenny TC <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
Tested-by: Chanwoo Choi <[email protected]>
--
Kernel-doc comment added by MyungJoo Ham
There was a case where free and list_del can be called twice
on the same pointer.So fixed it by re-arranging the code and
removing a function which was not needed.
Signed-off-by: anish kumar <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
Propagate the value returned from extcon_find_cable_index()
instead of -ENODEV. For readability, -EINVAL is returned in place of
the variable.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Since extcon registers this compat link at device registration
(extcon_dev_register), we should probably remove them at deregistration/cleanup.
Cc: [email protected]
Signed-off-by: Peter Huewe <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Rather than re-inventing the wheel we can use the hamming function
to calculate the number of bits set to check for violation of
exclusivity.
Signed-off-by: anish kumar <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
With this change now individual drivers can use standard cable
names as below:
static const char *arizona_cable[] = {
extcon_cable_name[EXTCON_USB],
extcon_cable_name[EXTCON_USB_HOST],
"CUSTOM_CABLE"
NULL,
}
Signed-off-by: anish kumar <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
The operation of lockdep requires that all dynamically allocated sysfs
nodes are initialised using sysfs_attr_init() otherwise lots of warnings
are generated. Ensure that all the dynamically allocated attributes that
extcon generates have this done.
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Replaced '_' with '-' in the extcon file names, which has been bogging
since new drivers have been using the standard naming.
Signed-off-by: MyungJoo Ham <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>