<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/extcon/extcon.c, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-07-19T14:21:52+00:00</updated>
<entry>
<title>extcon: Fix kernel doc of property capability fields to avoid warnings</title>
<updated>2023-07-19T14:21:52+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2023-03-22T14:39:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ac961d0571b4faad9ee6970248ccfc124c5b1463'/>
<id>urn:sha1:ac961d0571b4faad9ee6970248ccfc124c5b1463</id>
<content type='text'>
[ Upstream commit 73346b9965ebda2feb7fef8629e9b28baee820e3 ]

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 &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>extcon: Fix kernel doc of property fields to avoid warnings</title>
<updated>2023-07-19T14:21:52+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2023-03-22T14:39:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e4c94de6ca2f70cee0ebe703ce452835046b2831'/>
<id>urn:sha1:e4c94de6ca2f70cee0ebe703ce452835046b2831</id>
<content type='text'>
[ Upstream commit 7e77e0b7a9f4cdf91cb0950749b40c840ea63efc ]

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 &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>extcon: Add EXTCON_DISP_CVBS and EXTCON_DISP_EDP</title>
<updated>2022-07-15T02:37:41+00:00</updated>
<author>
<name>Michael Wu</name>
<email>michael@allwinnertech.com</email>
</author>
<published>2022-07-08T09:57:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3a06ed80265fa62eecaf519d92f1633e4f9510c7'/>
<id>urn:sha1:3a06ed80265fa62eecaf519d92f1633e4f9510c7</id>
<content type='text'>
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 &lt;michael@allwinnertech.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>extcon: Drop unexpected word "the" in the comments</title>
<updated>2022-07-15T02:37:40+00:00</updated>
<author>
<name>Jiang Jian</name>
<email>jiangjian@cdjrlc.com</email>
</author>
<published>2022-06-21T11:50:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=97e1bb93e7211f5468d0ebc9007331b58a074461'/>
<id>urn:sha1:97e1bb93e7211f5468d0ebc9007331b58a074461</id>
<content type='text'>
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-&gt;supported_cable */
changed to
/* Find the index of extcon cable in edev-&gt;supported_cable */

Signed-off-by: Jiang Jian &lt;jiangjian@cdjrlc.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>extcon: Modify extcon device to be created after driver data is set</title>
<updated>2022-05-13T08:03:41+00:00</updated>
<author>
<name>bumwoo lee</name>
<email>bw365.lee@samsung.com</email>
</author>
<published>2022-04-27T03:00:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5dcc2afe716d69f5112ce035cb14f007461ff189'/>
<id>urn:sha1:5dcc2afe716d69f5112ce035cb14f007461ff189</id>
<content type='text'>
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:
[&lt;c067865c&gt;] (state_show) from [&lt;c05222e8&gt;] (dev_attr_show)
[&lt;c05222c0&gt;] (dev_attr_show) from [&lt;c02c66e0&gt;] (sysfs_kf_seq_show)
[&lt;c02c6648&gt;] (sysfs_kf_seq_show) from [&lt;c02c496c&gt;] (kernfs_seq_show)
[&lt;c02c4938&gt;] (kernfs_seq_show) from [&lt;c025e2a0&gt;] (seq_read)
[&lt;c025e11c&gt;] (seq_read) from [&lt;c02c50a0&gt;] (kernfs_fop_read)
[&lt;c02c5064&gt;] (kernfs_fop_read) from [&lt;c0231cac&gt;] (__vfs_read)
[&lt;c0231c5c&gt;] (__vfs_read) from [&lt;c0231ee0&gt;] (vfs_read)
[&lt;c0231e34&gt;] (vfs_read) from [&lt;c0232464&gt;] (ksys_read)
[&lt;c02323f0&gt;] (ksys_read) from [&lt;c02324fc&gt;] (sys_read)
[&lt;c02324e4&gt;] (sys_read) from [&lt;c00091d0&gt;] (__sys_trace_return)

Signed-off-by: bumwoo lee &lt;bw365.lee@samsung.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>extcon: Fix some kernel-doc comments</title>
<updated>2022-05-13T08:03:40+00:00</updated>
<author>
<name>Yang Li</name>
<email>yang.lee@linux.alibaba.com</email>
</author>
<published>2022-01-04T08:43:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6506f6a0208d684e77832ccd83684ee5f259a19a'/>
<id>urn:sha1:6506f6a0208d684e77832ccd83684ee5f259a19a</id>
<content type='text'>
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 &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Yang Li &lt;yang.lee@linux.alibaba.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>extcon: Fix extcon_get_extcon_dev() error handling</title>
<updated>2022-05-13T08:03:40+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2021-12-17T06:28:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=58e4a2d27d3255e4e8c507fdc13734dccc9fc4c7'/>
<id>urn:sha1:58e4a2d27d3255e4e8c507fdc13734dccc9fc4c7</id>
<content type='text'>
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-&gt;edev = extcon_get_extcon_dev(acpi_dev_name(adev));
	if (IS_ERR(dev-&gt;edev))
		return PTR_ERR(dev-&gt;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 &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Reviewed-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Acked-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>extcon: Deduplicate code in extcon_set_state_sync()</title>
<updated>2021-12-24T06:27:52+00:00</updated>
<author>
<name>Alexander Stein</name>
<email>alexander.stein@ew.tq-group.com</email>
</author>
<published>2021-11-23T14:53:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2da3db7f498d8b6137566b4869d289938b69de13'/>
<id>urn:sha1:2da3db7f498d8b6137566b4869d289938b69de13</id>
<content type='text'>
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 &lt;alexander.stein@ew.tq-group.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>extcon: Fix error handling in extcon_dev_register</title>
<updated>2021-03-15T02:09:38+00:00</updated>
<author>
<name>Dinghao Liu</name>
<email>dinghao.liu@zju.edu.cn</email>
</author>
<published>2021-01-19T08:10:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d3bdd1c3140724967ca4136755538fa7c05c2b4e'/>
<id>urn:sha1:d3bdd1c3140724967ca4136755538fa7c05c2b4e</id>
<content type='text'>
When devm_kcalloc() fails, we should execute device_unregister()
to unregister edev-&gt;dev from system.

Fixes: 046050f6e623e ("extcon: Update the prototype of extcon_register_notifier() with enum extcon")
Signed-off-by: Dinghao Liu &lt;dinghao.liu@zju.edu.cn&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>extcon: remove redundant assignment to variable idx</title>
<updated>2020-05-29T08:36:01+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2020-04-15T23:08:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1fa80f182794bbefe8f1bffd74abda5470cdd973'/>
<id>urn:sha1:1fa80f182794bbefe8f1bffd74abda5470cdd973</id>
<content type='text'>
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 &lt;colin.king@canonical.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
</feed>
