Commit Graph

6 Commits

Author SHA1 Message Date
Stephen Rothwell
2ba7e513ef Merge branch 'extcon-next' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git 2024-12-20 14:20:12 +11:00
Charles Han
91329cb0a8 extcon: realtek: fix NULL deref check in extcon_rtk_type_c_probe
In extcon_rtk_type_c_probe() devm_kzalloc() may return NULL but this
returned value is not checked.

Fixes: 8a590d7371 ("extcon: add Realtek DHC RTD SoC Type-C driver")
Link: https://lore.kernel.org/lkml/20241025094650.253599-1-hanchunchao@inspur.com/
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-12-08 21:59:39 +09:00
Linus Torvalds
e70140ba0d Get rid of 'remove_new' relic from platform driver struct
The continual trickle of small conversion patches is grating on me, and
is really not helping.  Just get rid of the 'remove_new' member
function, which is just an alias for the plain 'remove', and had a
comment to that effect:

  /*
   * .remove_new() is a relic from a prototype conversion of .remove().
   * New drivers are supposed to implement .remove(). Once all drivers are
   * converted to not use .remove_new any more, it will be dropped.
   */

This was just a tree-wide 'sed' script that replaced '.remove_new' with
'.remove', with some care taken to turn a subsequent tab into two tabs
to make things line up.

I did do some minimal manual whitespace adjustment for places that used
spaces to line things up.

Then I just removed the old (sic) .remove_new member function, and this
is the end result.  No more unnecessary conversion noise.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-01 15:12:43 -08:00
Andy Shevchenko
986c51b959 extcon: realtek: Remove unused of_gpio.h
of_gpio.h is deprecated and subject to remove.
The driver doesn't use it, simply remove the unused header.

Link: https://lore.kernel.org/lkml/20240304174913.1198974-1-andriy.shevchenko@linux.intel.com/
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-05-09 01:03:38 +09:00
Stanley Chang
b3edc3463d extcon: realtek: add the error handler for nvmem_cell_read
There are following smatch warning:
drivers/extcon/extcon-rtk-type-c.c:905 __updated_type_c_parameter_by_efuse()
error: 'buf' dereferencing possible ERR_PTR()

The nvmem_cell_read may fail to read. So, driver must handle failure cases.

Link: https://lore.kernel.org/all/20231016053510.28881-1-stanley_chang@realtek.com/

Fixes: 8a590d7371 ("extcon: add Realtek DHC RTD SoC Type-C driver")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/a469dd51-f5d5-4e8f-ba36-6c7cea046fb8@moroto.mountain/
Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2023-10-17 17:38:57 +09:00
Stanley Chang
8a590d7371 extcon: add Realtek DHC RTD SoC Type-C driver
This patch adds the extcon driver for Realtek DHC (digital home center)
RTD SoCs type-c module. This can be used to detect whether the port is
configured as a downstream or upstream facing port. And notify the status
of extcon to listeners.

Link: https://lore.kernel.org/lkml/20230904051253.23208-2-stanley_chang@realtek.com/
Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2023-10-06 11:25:11 +09:00