History log of /linux-6.15/drivers/extcon/extcon.c (Results 1 – 25 of 93)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3, v6.8-rc2, v6.8-rc1, v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6, v6.7-rc5, v6.7-rc4, v6.7-rc3
# e66523c7 24-Nov-2023 Yaxiong Tian <[email protected]>

extcon: fix possible name leak in extcon_dev_register()

In the error path after calling dev_set_name(), the device
name is leaked. To fix this, moving dev_set_name() after the
error path and before

extcon: fix possible name leak in extcon_dev_register()

In the error path after calling dev_set_name(), the device
name is leaked. To fix this, moving dev_set_name() after the
error path and before device_register.

Link: https://lore.kernel.org/lkml/TYZPR01MB4784ADCD3E951E0863F3DB72D5B8A@TYZPR01MB4784.apcprd01.prod.exchangelabs.com/
Signed-off-by: Yaxiong Tian <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


Revision tags: v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1, v6.5, v6.5-rc7, v6.5-rc6, v6.5-rc5, v6.5-rc4, v6.5-rc3, v6.5-rc2, v6.5-rc1, v6.4, v6.4-rc7, v6.4-rc6, v6.4-rc5, v6.4-rc4, v6.4-rc3, v6.4-rc2, v6.4-rc1, v6.3, v6.3-rc7
# 93e60cd5 11-Apr-2023 Andy Shevchenko <[email protected]>

extcon: Drop unneeded assignments

In one case the assignment is duplicative, in the other,
it's better to move it into the loop — the user of it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@l

extcon: Drop unneeded assignments

In one case the assignment is duplicative, in the other,
it's better to move it into the loop — the user of it.

Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# ef753fb4 11-Apr-2023 Andy Shevchenko <[email protected]>

extcon: Use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type).
The type of the variable can change and one needs not change
the former (unlike

extcon: Use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type).
The type of the variable can change and one needs not change
the former (unlike the latter). No functional change intended.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# 7bba9e81 11-Apr-2023 Andy Shevchenko <[email protected]>

extcon: Use unique number for the extcon device ID

The use of atomic variable is still racy when we do not control which
device has been unregistered and there is a (theoretical) possibility
of the

extcon: Use unique number for the extcon device ID

The use of atomic variable is still racy when we do not control which
device has been unregistered and there is a (theoretical) possibility
of the overflow that may cause a duplicate extcon device ID number
to be allocated next time a device is registered.

Replace above mentioned approach by using IDA framework.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


Revision tags: v6.3-rc6, v6.3-rc5, v6.3-rc4
# 566825a3 22-Mar-2023 Andy Shevchenko <[email protected]>

extcon: Remove dup device name in the message and unneeded error check

The device name is already printed with dev_err(), no need to repeat.
The device pointer itself is not supposed to be an error

extcon: Remove dup device name in the message and unneeded error check

The device name is already printed with dev_err(), no need to repeat.
The device pointer itself is not supposed to be an error point, drop
that check.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# 9b4aea51 22-Mar-2023 Andy Shevchenko <[email protected]>

extcon: Use dev_of_node(dev) instead of dev->of_node

The dev_of_node function should be preferred.
In the result we may drop unneeded NULL check
of the pointer to the device object.

Signed-off-by:

extcon: Use dev_of_node(dev) instead of dev->of_node

The dev_of_node function should be preferred.
In the result we may drop unneeded NULL check
of the pointer to the device object.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# 0146f56b 22-Mar-2023 Andy Shevchenko <[email protected]>

extcon: Use device_match_of_node() helper

Instead of open coding, use device_match_of_node() helper.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Chanwoo Choi <

extcon: Use device_match_of_node() helper

Instead of open coding, use device_match_of_node() helper.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# 6ee0a22e 22-Mar-2023 Andy Shevchenko <[email protected]>

extcon: Use sysfs_emit() to instead of sprintf()

Follow the advice of the Documentation/filesystems/sysfs.rst that
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to

extcon: Use sysfs_emit() to instead of sprintf()

Follow the advice of the Documentation/filesystems/sysfs.rst that
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# 6e4e8670 22-Mar-2023 Andy Shevchenko <[email protected]>

extcon: Use DECLARE_BITMAP() to declare bit arrays

Bit arrays has a specific type helper for the declaration.
Use it instead of homegronw equivalent.

Signed-off-by: Andy Shevchenko <andriy.shevchen

extcon: Use DECLARE_BITMAP() to declare bit arrays

Bit arrays has a specific type helper for the declaration.
Use it instead of homegronw equivalent.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# 73346b99 22-Mar-2023 Andy Shevchenko <[email protected]>

extcon: Fix kernel doc of property capability fields to avoid warnings

Kernel documentation has to be synchronized with a code, otherwise
the validator is not happy:

Function parameter or memb

extcon: Fix kernel doc of property capability fields to avoid warnings

Kernel documentation has to be synchronized with a code, otherwise
the validator is not happy:

Function parameter or member 'usb_bits' not described in 'extcon_cable'
Function parameter or member 'chg_bits' not described in 'extcon_cable'
Function parameter or member 'jack_bits' not described in 'extcon_cable'
Function parameter or member 'disp_bits' not described in 'extcon_cable'

Describe the fields added in the past.

Fixes: ceaa98f442cf ("extcon: Add the support for the capability of each property")
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# 7e77e0b7 22-Mar-2023 Andy Shevchenko <[email protected]>

extcon: Fix kernel doc of property fields to avoid warnings

Kernel documentation has to be synchronized with a code, otherwise
the validator is not happy:

Function parameter or member 'usb_pro

extcon: Fix kernel doc of property fields to avoid warnings

Kernel documentation has to be synchronized with a code, otherwise
the validator is not happy:

Function parameter or member 'usb_propval' not described in 'extcon_cable'
Function parameter or member 'chg_propval' not described in 'extcon_cable'
Function parameter or member 'jack_propval' not described in 'extcon_cable'
Function parameter or member 'disp_propval' not described in 'extcon_cable'

Describe the fields added in the past.

Fixes: 067c1652e7a7 ("extcon: Add the support for extcon property according to extcon type")
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# 04151575 20-Mar-2023 Bumwoo Lee <[email protected]>

extcon: Add extcon_alloc_groups to simplify extcon register function

The alloc groups is functionalized from extcon_dev_register.

Signed-off-by: Bumwoo Lee <[email protected]>
Acked-by: MyungJo

extcon: Add extcon_alloc_groups to simplify extcon register function

The alloc groups is functionalized from extcon_dev_register.

Signed-off-by: Bumwoo Lee <[email protected]>
Acked-by: MyungJoo Ham <[email protected]
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# 3e70a014 20-Mar-2023 Bumwoo Lee <[email protected]>

extcon: Add extcon_alloc_muex to simplify extcon register function

The mutual exclusive part is functionalized from extcon_dev_register.

Signed-off-by: Bumwoo Lee <[email protected]>
Acked-by:

extcon: Add extcon_alloc_muex to simplify extcon register function

The mutual exclusive part is functionalized from extcon_dev_register.

Signed-off-by: Bumwoo Lee <[email protected]>
Acked-by: MyungJoo Ham <[email protected]
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# 3d9138e5 20-Mar-2023 Bumwoo Lee <[email protected]>

extcon: Add extcon_alloc_cables to simplify extcon register function

The cable allocation part is functionalized from extcon_dev_register.

Signed-off-by: Bumwoo Lee <[email protected]>
Acked-by

extcon: Add extcon_alloc_cables to simplify extcon register function

The cable allocation part is functionalized from extcon_dev_register.

Signed-off-by: Bumwoo Lee <[email protected]>
Acked-by: MyungJoo Ham <[email protected]
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


Revision tags: v6.3-rc3, v6.3-rc2, v6.3-rc1
# 7f4c9bc2 02-Mar-2023 Bumwoo Lee <[email protected]>

extcon: Remove redundant null checking for class

create_extcon_class() is already Null checking.

Signed-off-by: Bumwoo Lee <[email protected]>
Acked-by: MyungJoo Ham <[email protected]
S

extcon: Remove redundant null checking for class

create_extcon_class() is already Null checking.

Signed-off-by: Bumwoo Lee <[email protected]>
Acked-by: MyungJoo Ham <[email protected]
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


# 1aaba11d 13-Mar-2023 Greg Kroah-Hartman <[email protected]>

driver core: class: remove module * from class_create()

The module pointer in class_create() never actually did anything, and it
shouldn't have been requred to be set as a parameter even if it did
s

driver core: class: remove module * from class_create()

The module pointer in class_create() never actually did anything, and it
shouldn't have been requred to be set as a parameter even if it did
something. So just remove it and fix up all callers of the function in
the kernel tree at the same time.

Cc: "Rafael J. Wysocki" <[email protected]>
Acked-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>

show more ...


Revision tags: v6.2, v6.2-rc8, v6.2-rc7, v6.2-rc6, v6.2-rc5, v6.2-rc4, v6.2-rc3, v6.2-rc2, v6.2-rc1, v6.1, v6.1-rc8, v6.1-rc7, v6.1-rc6, v6.1-rc5, v6.1-rc4, v6.1-rc3, v6.1-rc2, v6.1-rc1, v6.0, v6.0-rc7, v6.0-rc6, v6.0-rc5, v6.0-rc4, v6.0-rc3, v6.0-rc2, v6.0-rc1, v5.19, v5.19-rc8, v5.19-rc7, v5.19-rc6
# 3a06ed80 08-Jul-2022 Michael Wu <[email protected]>

extcon: Add EXTCON_DISP_CVBS and EXTCON_DISP_EDP

Add EXTCON_DISP_CVBS for Composite Video Broadcast Signal.
Add EXTCON_DISP_EDP for Embedded Display Port

[1] https://en.wikipedia.org/wiki/Composite

extcon: Add EXTCON_DISP_CVBS and EXTCON_DISP_EDP

Add EXTCON_DISP_CVBS for Composite Video Broadcast Signal.
Add EXTCON_DISP_EDP for Embedded Display Port

[1] https://en.wikipedia.org/wiki/Composite_video
[2] https://en.wikipedia.org/wiki/DisplayPort#eDP

Signed-off-by: Michael Wu <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


Revision tags: v5.19-rc5, v5.19-rc4
# 97e1bb93 21-Jun-2022 Jiang Jian <[email protected]>

extcon: Drop unexpected word "the" in the comments

there is an unexpected word "the" in the comments that need to be dropped

file: ./drivers/extcon/extcon.c
line: 250

/* Find the the index of extc

extcon: Drop unexpected word "the" in the comments

there is an unexpected word "the" in the comments that need to be dropped

file: ./drivers/extcon/extcon.c
line: 250

/* Find the the index of extcon cable in edev->supported_cable */
changed to
/* Find the index of extcon cable in edev->supported_cable */

Signed-off-by: Jiang Jian <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


Revision tags: v5.19-rc3, v5.19-rc2, v5.19-rc1, v5.18, v5.18-rc7, v5.18-rc6, v5.18-rc5
# 5dcc2afe 27-Apr-2022 bumwoo lee <[email protected]>

extcon: Modify extcon device to be created after driver data is set

Currently, someone can invoke the sysfs such as state_show()
intermittently before dev_set_drvdata() is done.
And it can be a caus

extcon: Modify extcon device to be created after driver data is set

Currently, someone can invoke the sysfs such as state_show()
intermittently before dev_set_drvdata() is done.
And it can be a cause of kernel Oops because of edev is Null at that time.
So modified the driver registration to after setting drviver data.

- Oops's backtrace.

Backtrace:
[<c067865c>] (state_show) from [<c05222e8>] (dev_attr_show)
[<c05222c0>] (dev_attr_show) from [<c02c66e0>] (sysfs_kf_seq_show)
[<c02c6648>] (sysfs_kf_seq_show) from [<c02c496c>] (kernfs_seq_show)
[<c02c4938>] (kernfs_seq_show) from [<c025e2a0>] (seq_read)
[<c025e11c>] (seq_read) from [<c02c50a0>] (kernfs_fop_read)
[<c02c5064>] (kernfs_fop_read) from [<c0231cac>] (__vfs_read)
[<c0231c5c>] (__vfs_read) from [<c0231ee0>] (vfs_read)
[<c0231e34>] (vfs_read) from [<c0232464>] (ksys_read)
[<c02323f0>] (ksys_read) from [<c02324fc>] (sys_read)
[<c02324e4>] (sys_read) from [<c00091d0>] (__sys_trace_return)

Signed-off-by: bumwoo lee <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


Revision tags: v5.18-rc4, v5.18-rc3, v5.18-rc2, v5.18-rc1, v5.17, v5.17-rc8, v5.17-rc7, v5.17-rc6, v5.17-rc5, v5.17-rc4, v5.17-rc3, v5.17-rc2, v5.17-rc1, v5.16
# 6506f6a0 04-Jan-2022 Yang Li <[email protected]>

extcon: Fix some kernel-doc comments

Add the description of @id in extcon_sync() kernel-doc comment
and @edev, @id, @prop in extcon_set_property_sync() kernel-doc
comment to remove warnings found by

extcon: Fix some kernel-doc comments

Add the description of @id in extcon_sync() kernel-doc comment
and @edev, @id, @prop in extcon_set_property_sync() kernel-doc
comment to remove warnings found by running scripts/kernel-doc,
which is caused by using 'make W=1'.
drivers/extcon/extcon.c:409: warning: Function parameter or
member 'id' not described in 'extcon_sync'
drivers/extcon/extcon.c:750: warning: Function parameter or
member 'edev' not described in 'extcon_set_property_sync'
drivers/extcon/extcon.c:750: warning: Function parameter or
member 'id' not described in 'extcon_set_property_sync'
drivers/extcon/extcon.c:750: warning: Function parameter or
member 'prop' not described in 'extcon_set_property_sync'

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


Revision tags: v5.16-rc8, v5.16-rc7, v5.16-rc6
# 58e4a2d2 17-Dec-2021 Dan Carpenter <[email protected]>

extcon: Fix extcon_get_extcon_dev() error handling

The extcon_get_extcon_dev() function returns error pointers on error,
NULL when it's a -EPROBE_DEFER defer situation, and ERR_PTR(-ENODEV)
when the

extcon: Fix extcon_get_extcon_dev() error handling

The extcon_get_extcon_dev() function returns error pointers on error,
NULL when it's a -EPROBE_DEFER defer situation, and ERR_PTR(-ENODEV)
when the CONFIG_EXTCON option is disabled. This is very complicated for
the callers to handle and a number of them had bugs that would lead to
an Oops.

In real life, there are two things which prevented crashes. First,
error pointers would only be returned if there was bug in the caller
where they passed a NULL "extcon_name" and none of them do that.
Second, only two out of the eight drivers will build when CONFIG_EXTCON
is disabled.

The normal way to write this would be to return -EPROBE_DEFER directly
when appropriate and return NULL when CONFIG_EXTCON is disabled. Then
the error handling is simple and just looks like:

dev->edev = extcon_get_extcon_dev(acpi_dev_name(adev));
if (IS_ERR(dev->edev))
return PTR_ERR(dev->edev);

For the two drivers which can build with CONFIG_EXTCON disabled, then
extcon_get_extcon_dev() will now return NULL which is not treated as an
error and the probe will continue successfully. Those two drivers are
"typec_fusb302" and "max8997-battery". In the original code, the
typec_fusb302 driver had an 800ms hang in tcpm_get_current_limit() but
now that function is a no-op. For the max8997-battery driver everything
should continue working as is.

Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Reviewed-by: Heikki Krogerus <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Acked-by: Sebastian Reichel <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


Revision tags: v5.16-rc5, v5.16-rc4, v5.16-rc3
# 2da3db7f 23-Nov-2021 Alexander Stein <[email protected]>

extcon: Deduplicate code in extcon_set_state_sync()

Finding the cable index and checking for changed status is also done
in extcon_set_state(). So calling extcon_set_state_sync() will do these
check

extcon: Deduplicate code in extcon_set_state_sync()

Finding the cable index and checking for changed status is also done
in extcon_set_state(). So calling extcon_set_state_sync() will do these
checks twice. Remove them and use these checks from extcon_set_state().

Signed-off-by: Alexander Stein <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


Revision tags: v5.16-rc2, v5.16-rc1, v5.15, v5.15-rc7, v5.15-rc6, v5.15-rc5, v5.15-rc4, v5.15-rc3, v5.15-rc2, v5.15-rc1, v5.14, v5.14-rc7, v5.14-rc6, v5.14-rc5, v5.14-rc4, v5.14-rc3, v5.14-rc2, v5.14-rc1, v5.13, v5.13-rc7, v5.13-rc6, v5.13-rc5, v5.13-rc4, v5.13-rc3, v5.13-rc2, v5.13-rc1, v5.12, v5.12-rc8, v5.12-rc7, v5.12-rc6, v5.12-rc5, v5.12-rc4, v5.12-rc3, v5.12-rc2, v5.12-rc1, v5.12-rc1-dontuse, v5.11, v5.11-rc7, v5.11-rc6, v5.11-rc5
# d3bdd1c3 19-Jan-2021 Dinghao Liu <[email protected]>

extcon: Fix error handling in extcon_dev_register

When devm_kcalloc() fails, we should execute device_unregister()
to unregister edev->dev from system.

Fixes: 046050f6e623e ("extcon: Update the pro

extcon: Fix error handling in extcon_dev_register

When devm_kcalloc() fails, we should execute device_unregister()
to unregister edev->dev from system.

Fixes: 046050f6e623e ("extcon: Update the prototype of extcon_register_notifier() with enum extcon")
Signed-off-by: Dinghao Liu <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


Revision tags: v5.11-rc4, v5.11-rc3, v5.11-rc2, v5.11-rc1, v5.10, v5.10-rc7, v5.10-rc6, v5.10-rc5, v5.10-rc4, v5.10-rc3, v5.10-rc2, v5.10-rc1, v5.9, v5.9-rc8, v5.9-rc7, v5.9-rc6, v5.9-rc5, v5.9-rc4, v5.9-rc3, v5.9-rc2, v5.9-rc1, v5.8, v5.8-rc7, v5.8-rc6, v5.8-rc5, v5.8-rc4, v5.8-rc3, v5.8-rc2, v5.8-rc1, v5.7, v5.7-rc7, v5.7-rc6, v5.7-rc5, v5.7-rc4, v5.7-rc3, v5.7-rc2
# 1fa80f18 15-Apr-2020 Colin Ian King <[email protected]>

extcon: remove redundant assignment to variable idx

The variable idx is being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redun

extcon: remove redundant assignment to variable idx

The variable idx is being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


Revision tags: v5.7-rc1, v5.6, v5.6-rc7
# 995bb109 16-Mar-2020 Mayank Rana <[email protected]>

extcon: Mark extcon_get_edev_name() function as exported symbol

extcon_get_edev_name() function provides client driver to request
extcon dev's name. If extcon driver and client driver are compiled
a

extcon: Mark extcon_get_edev_name() function as exported symbol

extcon_get_edev_name() function provides client driver to request
extcon dev's name. If extcon driver and client driver are compiled
as loadable modules, extcon_get_edev_name() function symbol is not
visible to client driver. Hence mark extcon_find_edev_name() function
as exported symbol.

Signed-off-by: Mayank Rana <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>

show more ...


1234