Commit Graph

5 Commits

Author SHA1 Message Date
Uwe Kleine-König
6d472f20c3 extcon: intel-mrfld: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Link: https://lore.kernel.org/lkml/7223e19152980ef553e38cf56c2b38ec099586e0.1708876186.git.u.kleine-koenig@pengutronix.de/
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-05-09 01:03:38 +09:00
Andy Shevchenko
b1a8804f53 extcon: intel-mrfld: Don't shadow error from devm_extcon_dev_allocate()
Don't shadow error from devm_extcon_dev_allocate() and return it as is.

Link: https://lore.kernel.org/lkml/20231222161854.2955859-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
Andy Shevchenko
217f036242 extcon: intel-mrfld: Switch to use dev_err_probe()
Switch to use dev_err_probe() to simplify the error path and
unify a message template.

Link: https://lore.kernel.org/lkml/20231222161954.2955905-1-andriy.shevchenko@linux.intel.com/
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2024-05-09 01:03:38 +09:00
Ferry Toth
ecb5bdff90 extcon: intel-mrfld: Sync hardware and software state on init
extcon driver for Basin Cove PMIC shadows the switch status used for dwc3
DRD to detect a change in the switch position. This change initializes the
status at probe time.

Cc: stable@vger.kernel.org
Fixes: 492929c547 ("extcon: mrfld: Introduce extcon driver for Basin Cove PMIC")
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2021-06-21 18:28:00 +09:00
Andy Shevchenko
492929c547 extcon: mrfld: Introduce extcon driver for Basin Cove PMIC
On Intel Merrifield the Basin Cove PMIC provides a feature to detect
the USB connection type. This driver utilizes the feature in order
to support the USB dual role detection.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2019-04-05 10:21:41 +09:00