History

Merge tag 'extcon-next-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next

Chanwoo writes: Update extcon next for v5.19 Detailed description for this pull request: 1. update extcon core driver - extcon_get_extcon_dev() has been almost used to get the extcon device on booting time. If extcon provider driver is probed at late time, the extcon consumer driver get the -EPROBE_DEFER return value. It requires the inefficient handling code of -EPROBE_DEFER. Instead, extcon_get_extcon_dev() will return -EPROBE_DEFER if the required extcon device is none. It makes the extcon consumer driver to be simplified when getting extcon device. - Register device after dev_set_drvdata because of accessing the sysfs attributes at timing of between drv_set_data and device_register. - Fix some kernel-doc comments of extcon functions. 2. update extcon provider driver - Update extcon-intel-int3496.c : Add support for controlling vbus power via regulator and support to the extcon-intel-int3496.c driver to bind to devices without an ACPi companion. And fix the minor clean-up. - Use struct_size() helper on extcon-usbc-cros-ec.c - Remove the disable irq operation in system sleep for using vbus/id gpio as the wakeup source on extcon-usb-gpio.c - Add support of SM5703 device by using existing extcon-sm5502.c and rename i2c_devic_id from sm5703 to sm5703-muic to reduce confusion between SM5703 MFD device and extcon device. - Add usb role class support and add queue work sync before driver release on extcon-ptn5150.c * tag 'extcon-next-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: Modify extcon device to be created after driver data is set extcon: sm5502: Clarify SM5703's i2c device ID extcon: ptn5150: Add usb role class support extcon: ptn5150: Add queue work sync before driver release extcon: sm5502: Add support for SM5703 dt-bindings: extcon: bindings for SM5703 extcon: usb-gpio: Remove disable irq operation in system sleep extcon: Fix some kernel-doc comments extcon: usbc-cros-ec: Use struct_size() helper in kzalloc() extcon: int3496: Add support for controlling Vbus through a regulator extcon: int3496: Add support for binding to plain platform devices extcon: int3496: Request non-exclusive access to the ID GPIO extcon: int3496: Make the driver a bit less verbose extcon: Fix extcon_get_extcon_dev() error handling

Greg Kroah-Hartman committed 4 years ago

Commit e727efe2 parents fa5602c 5dcc2af16 files · +139 −70Browse files

Unified · Split

16 files
  1. Documentation/devicetree/bindings/extcon/siliconmitus,sm5502-muic.yaml +3 −2
  2. drivers/extcon/Kconfig +2 −1
  3. drivers/extcon/extcon-axp288.c +2 −2
  4. drivers/extcon/extcon-intel-int3496.c +46 −8
  5. drivers/extcon/extcon-ptn5150.c +36 −0
  6. drivers/extcon/extcon-sm5502.c +2 −0
  7. drivers/extcon/extcon-usb-gpio.c +0 −15
  8. drivers/extcon/extcon-usbc-cros-ec.c +1 −1
  9. drivers/extcon/extcon.c +24 −13
  10. drivers/power/supply/axp288_charger.c +10 −7
  11. drivers/power/supply/charger-manager.c +2 −5
  12. drivers/power/supply/max8997_charger.c +4 −4
  13. drivers/usb/dwc3/drd.c +2 −7
  14. drivers/usb/phy/phy-omap-otg.c +2 −2
  15. drivers/usb/typec/tcpm/fusb302.c +2 −2
  16. include/linux/extcon.h +1 −1
Documentation/devicetree/bindings/extcon/siliconmitus,sm5502-muic.yaml+3−2
@@ -20,11 +20,12 @@ properties: · 19 unmodified lines
2020 enum:
2121 - siliconmitus,sm5502-muic
2222 - siliconmitus,sm5504-muic
23+ - siliconmitus,sm5703-muic
2324
2425 reg:
2526 maxItems: 1
26− description: I2C slave address of the device. Usually 0x25 for SM5502,
27− 0x14 for SM5504.
27+ description: I2C slave address of the device. Usually 0x25 for SM5502
28+ and SM5703, 0x14 for SM5504.
2829
2930 interrupts:
3031 maxItems: 1
drivers/extcon/Kconfig+2−1
@@ -131,6 +131,7 @@ config EXTCON_PALMAS · 130 unmodified lines
131131 config EXTCON_PTN5150
132132 tristate "NXP PTN5150 CC LOGIC USB EXTCON support"
133133 depends on I2C && (GPIOLIB || COMPILE_TEST)
134+ depends on USB_ROLE_SWITCH || !USB_ROLE_SWITCH
134135 select REGMAP_I2C
135136 help
136137 Say Y here to enable support for USB peripheral and USB host
@@ -156,7 +157,7 @@ config EXTCON_RT8973A · 19 unmodified lines
156157 from abnormal high input voltage (up to 28V).
157158
158159 config EXTCON_SM5502
159− tristate "Silicon Mitus SM5502/SM5504 EXTCON support"
160+ tristate "Silicon Mitus SM5502/SM5504/SM5703 EXTCON support"
160161 depends on I2C
161162 select IRQ_DOMAIN
162163 select REGMAP_I2C
drivers/extcon/extcon-axp288.c+2−2
@@ -394,8 +394,8 @@ static int axp288_extcon_probe(struct platform_device *pdev) · 393 unmodified lines
394394 if (adev) {
395395 info->id_extcon = extcon_get_extcon_dev(acpi_dev_name(adev));
396396 put_device(&adev->dev);
397− if (!info->id_extcon)
398− return -EPROBE_DEFER;
397+ if (IS_ERR(info->id_extcon))
398+ return PTR_ERR(info->id_extcon);
399399
400400 dev_info(dev, "controlling USB role\n");
401401 } else {
drivers/extcon/extcon-intel-int3496.c+46−8
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/interrupt.h>
1818 #include <linux/module.h>
1919 #include <linux/platform_device.h>
20+#include <linux/regulator/consumer.h>
2021
2122 #define INT3496_GPIO_USB_ID 0
2223 #define INT3496_GPIO_VBUS_EN 1
@@ -30,7 +31,9 @@ struct int3496_data { · 7 unmodified lines
3031 struct gpio_desc *gpio_usb_id;
3132 struct gpio_desc *gpio_vbus_en;
3233 struct gpio_desc *gpio_usb_mux;
34+ struct regulator *vbus_boost;
3335 int usb_id_irq;
36+ bool vbus_boost_enabled;
3437 };
3538
3639 static const unsigned int int3496_cable[] = {
@@ -53,6 +56,27 @@ static const struct acpi_gpio_mapping acpi_int3496_default_gpios[] = { · 16 unmodified lines
5356 { },
5457 };
5558
59+static void int3496_set_vbus_boost(struct int3496_data *data, bool enable)
60+{
61+ int ret;
62+
63+ if (IS_ERR_OR_NULL(data->vbus_boost))
64+ return;
65+
66+ if (data->vbus_boost_enabled == enable)
67+ return;
68+
69+ if (enable)
70+ ret = regulator_enable(data->vbus_boost);
71+ else
72+ ret = regulator_disable(data->vbus_boost);
73+
74+ if (ret == 0)
75+ data->vbus_boost_enabled = enable;
76+ else
77+ dev_err(data->dev, "Error updating Vbus boost regulator: %d\n", ret);
78+}
79+
5680 static void int3496_do_usb_id(struct work_struct *work)
5781 {
5882 struct int3496_data *data =
@@ -71,6 +95,8 @@ static void int3496_do_usb_id(struct work_struct *work) · 12 unmodified lines
7195
7296 if (!IS_ERR(data->gpio_vbus_en))
7397 gpiod_direction_output(data->gpio_vbus_en, !id);
98+ else
99+ int3496_set_vbus_boost(data, !id);
74100
75101 extcon_set_state_sync(data->edev, EXTCON_USB_HOST, !id);
76102 }
@@ -91,10 +117,12 @@ static int int3496_probe(struct platform_device *pdev) · 14 unmodified lines
91117 struct int3496_data *data;
92118 int ret;
93119
94− ret = devm_acpi_dev_add_driver_gpios(dev, acpi_int3496_default_gpios);
95− if (ret) {
96− dev_err(dev, "can't add GPIO ACPI mapping\n");
97− return ret;
120+ if (has_acpi_companion(dev)) {
121+ ret = devm_acpi_dev_add_driver_gpios(dev, acpi_int3496_default_gpios);
122+ if (ret) {
123+ dev_err(dev, "can't add GPIO ACPI mapping\n");
124+ return ret;
125+ }
98126 }
99127
100128 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
@@ -106,7 +134,8 @@ static int int3496_probe(struct platform_device *pdev) · 5 unmodified lines
106134 if (ret)
107135 return ret;
108136
109− data->gpio_usb_id = devm_gpiod_get(dev, "id", GPIOD_IN);
137+ data->gpio_usb_id =
138+ devm_gpiod_get(dev, "id", GPIOD_IN | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
110139 if (IS_ERR(data->gpio_usb_id)) {
111140 ret = PTR_ERR(data->gpio_usb_id);
112141 dev_err(dev, "can't request USB ID GPIO: %d\n", ret);
@@ -120,12 +149,14 @@ static int int3496_probe(struct platform_device *pdev) · 7 unmodified lines
120149 }
121150
122151 data->gpio_vbus_en = devm_gpiod_get(dev, "vbus", GPIOD_ASIS);
123− if (IS_ERR(data->gpio_vbus_en))
124− dev_info(dev, "can't request VBUS EN GPIO\n");
152+ if (IS_ERR(data->gpio_vbus_en)) {
153+ dev_dbg(dev, "can't request VBUS EN GPIO\n");
154+ data->vbus_boost = devm_regulator_get_optional(dev, "vbus");
155+ }
125156
126157 data->gpio_usb_mux = devm_gpiod_get(dev, "mux", GPIOD_ASIS);
127158 if (IS_ERR(data->gpio_usb_mux))
128− dev_info(dev, "can't request USB MUX GPIO\n");
159+ dev_dbg(dev, "can't request USB MUX GPIO\n");
129160
130161 /* register extcon device */
131162 data->edev = devm_extcon_dev_allocate(dev, int3496_cable);
@@ -164,12 +195,19 @@ static const struct acpi_device_id int3496_acpi_match[] = { · 32 unmodified lines
164195 };
165196 MODULE_DEVICE_TABLE(acpi, int3496_acpi_match);
166197
198+static const struct platform_device_id int3496_ids[] = {
199+ { .name = "intel-int3496" },
200+ {},
201+};
202+MODULE_DEVICE_TABLE(platform, int3496_ids);
203+
167204 static struct platform_driver int3496_driver = {
168205 .driver = {
169206 .name = "intel-int3496",
170207 .acpi_match_table = int3496_acpi_match,
171208 },
172209 .probe = int3496_probe,
210+ .id_table = int3496_ids,
173211 };
174212
175213 module_platform_driver(int3496_driver);
drivers/extcon/extcon-ptn5150.c+36−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/slab.h>
1818 #include <linux/extcon-provider.h>
1919 #include <linux/gpio/consumer.h>
20+#include <linux/usb/role.h>
2021
2122 /* PTN5150 registers */
2223 #define PTN5150_REG_DEVICE_ID 0x01
@@ -52,6 +53,7 @@ struct ptn5150_info { · 29 unmodified lines
5253 int irq;
5354 struct work_struct irq_work;
5455 struct mutex mutex;
56+ struct usb_role_switch *role_sw;
5557 };
5658
5759 /* List of detectable cables */
@@ -70,6 +72,7 @@ static const struct regmap_config ptn5150_regmap_config = { · 12 unmodified lines
7072 static void ptn5150_check_state(struct ptn5150_info *info)
7173 {
7274 unsigned int port_status, reg_data, vbus;
75+ enum usb_role usb_role = USB_ROLE_NONE;
7376 int ret;
7477
7578 ret = regmap_read(info->regmap, PTN5150_REG_CC_STATUS, &reg_data);
@@ -85,6 +88,7 @@ static void ptn5150_check_state(struct ptn5150_info *info) · 9 unmodified lines
8588 extcon_set_state_sync(info->edev, EXTCON_USB_HOST, false);
8689 gpiod_set_value_cansleep(info->vbus_gpiod, 0);
8790 extcon_set_state_sync(info->edev, EXTCON_USB, true);
91+ usb_role = USB_ROLE_DEVICE;
8892 break;
8993 case PTN5150_UFP_ATTACHED:
9094 extcon_set_state_sync(info->edev, EXTCON_USB, false);
@@ -95,10 +99,18 @@ static void ptn5150_check_state(struct ptn5150_info *info) · 4 unmodified lines
9599 gpiod_set_value_cansleep(info->vbus_gpiod, 1);
96100
97101 extcon_set_state_sync(info->edev, EXTCON_USB_HOST, true);
102+ usb_role = USB_ROLE_HOST;
98103 break;
99104 default:
100105 break;
101106 }
107+
108+ if (usb_role) {
109+ ret = usb_role_switch_set_role(info->role_sw, usb_role);
110+ if (ret)
111+ dev_err(info->dev, "failed to set %s role: %d\n",
112+ usb_role_string(usb_role), ret);
113+ }
102114 }
103115
104116 static void ptn5150_irq_work(struct work_struct *work)
@@ -133,6 +145,13 @@ static void ptn5150_irq_work(struct work_struct *work) · 28 unmodified lines
133145 extcon_set_state_sync(info->edev,
134146 EXTCON_USB, false);
135147 gpiod_set_value_cansleep(info->vbus_gpiod, 0);
148+
149+ ret = usb_role_switch_set_role(info->role_sw,
150+ USB_ROLE_NONE);
151+ if (ret)
152+ dev_err(info->dev,
153+ "failed to set none role: %d\n",
154+ ret);
136155 }
137156 }
138157
@@ -194,6 +213,14 @@ static int ptn5150_init_dev_type(struct ptn5150_info *info) · 55 unmodified lines
194213 return 0;
195214 }
196215
216+static void ptn5150_work_sync_and_put(void *data)
217+{
218+ struct ptn5150_info *info = data;
219+
220+ cancel_work_sync(&info->irq_work);
221+ usb_role_switch_put(info->role_sw);
222+}
223+
197224 static int ptn5150_i2c_probe(struct i2c_client *i2c)
198225 {
199226 struct device *dev = &i2c->dev;
@@ -284,6 +311,15 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c) · 84 unmodified lines
284311 if (ret)
285312 return -EINVAL;
286313
314+ info->role_sw = usb_role_switch_get(info->dev);
315+ if (IS_ERR(info->role_sw))
316+ return dev_err_probe(info->dev, PTR_ERR(info->role_sw),
317+ "failed to get role switch\n");
318+
319+ ret = devm_add_action_or_reset(dev, ptn5150_work_sync_and_put, info);
320+ if (ret)
321+ return ret;
322+
287323 /*
288324 * Update current extcon state if for example OTG connection was there
289325 * before the probe
drivers/extcon/extcon-sm5502.c+2−0
@@ -798,6 +798,7 @@ static const struct sm5502_type sm5504_data = { · 797 unmodified lines
798798 static const struct of_device_id sm5502_dt_match[] = {
799799 { .compatible = "siliconmitus,sm5502-muic", .data = &sm5502_data },
800800 { .compatible = "siliconmitus,sm5504-muic", .data = &sm5504_data },
801+ { .compatible = "siliconmitus,sm5703-muic", .data = &sm5502_data },
801802 { },
802803 };
803804 MODULE_DEVICE_TABLE(of, sm5502_dt_match);
@@ -830,6 +831,7 @@ static SIMPLE_DEV_PM_OPS(sm5502_muic_pm_ops, · 26 unmodified lines
830831 static const struct i2c_device_id sm5502_i2c_id[] = {
831832 { "sm5502", (kernel_ulong_t)&sm5502_data },
832833 { "sm5504", (kernel_ulong_t)&sm5504_data },
834+ { "sm5703-muic", (kernel_ulong_t)&sm5502_data },
833835 { }
834836 };
835837 MODULE_DEVICE_TABLE(i2c, sm5502_i2c_id);
drivers/extcon/extcon-usb-gpio.c+0−15
@@ -226,16 +226,6 @@ static int usb_extcon_suspend(struct device *dev) · 225 unmodified lines
226226 }
227227 }
228228
229− /*
230− * We don't want to process any IRQs after this point
231− * as GPIOs used behind I2C subsystem might not be
232− * accessible until resume completes. So disable IRQ.
233− */
234− if (info->id_gpiod)
235− disable_irq(info->id_irq);
236− if (info->vbus_gpiod)
237− disable_irq(info->vbus_irq);
238−
239229 if (!device_may_wakeup(dev))
240230 pinctrl_pm_select_sleep_state(dev);
241231
@@ -267,11 +257,6 @@ static int usb_extcon_resume(struct device *dev) · 25 unmodified lines
267257 }
268258 }
269259
270− if (info->id_gpiod)
271− enable_irq(info->id_irq);
272− if (info->vbus_gpiod)
273− enable_irq(info->vbus_irq);
274−
275260 queue_delayed_work(system_power_efficient_wq,
276261 &info->wq_detcable, 0);
277262
drivers/extcon/extcon-usbc-cros-ec.c+1−1
@@ -68,7 +68,7 @@ static int cros_ec_pd_command(struct cros_ec_extcon_info *info, · 67 unmodified lines
6868 struct cros_ec_command *msg;
6969 int ret;
7070
71− msg = kzalloc(sizeof(*msg) + max(outsize, insize), GFP_KERNEL);
71+ msg = kzalloc(struct_size(msg, data, max(outsize, insize)), GFP_KERNEL);
7272 if (!msg)
7373 return -ENOMEM;
7474
drivers/extcon/extcon.c+24−13
@@ -399,6 +399,7 @@ static ssize_t cable_state_show(struct device *dev, · 398 unmodified lines
399399 /**
400400 * extcon_sync() - Synchronize the state for an external connector.
401401 * @edev: the extcon device
402+ * @id: the unique id indicating an external connector
402403 *
403404 * Note that this function send a notification in order to synchronize
404405 * the state and property of an external connector.
@@ -736,6 +737,9 @@ EXPORT_SYMBOL_GPL(extcon_set_property); · 331 unmodified lines
736737
737738 /**
738739 * extcon_set_property_sync() - Set property of an external connector with sync.
740+ * @edev: the extcon device
741+ * @id: the unique id indicating an external connector
742+ * @prop: the property id indicating an extcon property
739743 * @prop_val: the pointer including the new value of extcon property
740744 *
741745 * Note that when setting the property value of external connector,
@@ -851,6 +855,8 @@ EXPORT_SYMBOL_GPL(extcon_set_property_capability); · 109 unmodified lines
851855 * @extcon_name: the extcon name provided with extcon_dev_register()
852856 *
853857 * Return the pointer of extcon device if success or ERR_PTR(err) if fail.
858+ * NOTE: This function returns -EPROBE_DEFER so it may only be called from
859+ * probe() functions.
854860 */
855861 struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name)
856862 {
@@ -864,7 +870,7 @@ struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name) · 7 unmodified lines
864870 if (!strcmp(sd->name, extcon_name))
865871 goto out;
866872 }
867− sd = NULL;
873+ sd = ERR_PTR(-EPROBE_DEFER);
868874 out:
869875 mutex_unlock(&extcon_dev_list_lock);
870876 return sd;
@@ -1218,19 +1224,14 @@ int extcon_dev_register(struct extcon_dev *edev) · 347 unmodified lines
12181224 edev->dev.type = &edev->extcon_dev_type;
12191225 }
12201226
1221− ret = device_register(&edev->dev);
1222− if (ret) {
1223− put_device(&edev->dev);
1224− goto err_dev;
1225− }
1226−
12271227 spin_lock_init(&edev->lock);
1228− edev->nh = devm_kcalloc(&edev->dev, edev->max_supported,
1229− sizeof(*edev->nh), GFP_KERNEL);
1230− if (!edev->nh) {
1231− ret = -ENOMEM;
1232− device_unregister(&edev->dev);
1233− goto err_dev;
1228+ if (edev->max_supported) {
1229+ edev->nh = kcalloc(edev->max_supported, sizeof(*edev->nh),
1230+ GFP_KERNEL);
1231+ if (!edev->nh) {
1232+ ret = -ENOMEM;
1233+ goto err_alloc_nh;
1234+ }
12341235 }
12351236
12361237 for (index = 0; index < edev->max_supported; index++)
@@ -1241,6 +1242,12 @@ int extcon_dev_register(struct extcon_dev *edev) · 4 unmodified lines
12411242 dev_set_drvdata(&edev->dev, edev);
12421243 edev->state = 0;
12431244
1245+ ret = device_register(&edev->dev);
1246+ if (ret) {
1247+ put_device(&edev->dev);
1248+ goto err_dev;
1249+ }
1250+
12441251 mutex_lock(&extcon_dev_list_lock);
12451252 list_add(&edev->entry, &extcon_dev_list);
12461253 mutex_unlock(&extcon_dev_list_lock);
@@ -1248,6 +1255,9 @@ int extcon_dev_register(struct extcon_dev *edev) · 1 unmodified line
12481255 return 0;
12491256
12501257 err_dev:
1258+ if (edev->max_supported)
1259+ kfree(edev->nh);
1260+err_alloc_nh:
12511261 if (edev->max_supported)
12521262 kfree(edev->extcon_dev_type.groups);
12531263 err_alloc_groups:
@@ -1308,6 +1318,7 @@ void extcon_dev_unregister(struct extcon_dev *edev) · 54 unmodified lines
13081318 if (edev->max_supported) {
13091319 kfree(edev->extcon_dev_type.groups);
13101320 kfree(edev->cables);
1321+ kfree(edev->nh);
13111322 }
13121323
13131324 put_device(&edev->dev);
drivers/power/supply/axp288_charger.c+10−7
@@ -865,17 +865,20 @@ static int axp288_charger_probe(struct platform_device *pdev) · 864 unmodified lines
865865 info->regmap_irqc = axp20x->regmap_irqc;
866866
867867 info->cable.edev = extcon_get_extcon_dev(AXP288_EXTCON_DEV_NAME);
868− if (info->cable.edev == NULL) {
869− dev_dbg(dev, "%s is not ready, probe deferred\n",
870− AXP288_EXTCON_DEV_NAME);
871− return -EPROBE_DEFER;
868+ if (IS_ERR(info->cable.edev)) {
869+ dev_err_probe(dev, PTR_ERR(info->cable.edev),
870+ "extcon_get_extcon_dev(%s) failed\n",
871+ AXP288_EXTCON_DEV_NAME);
872+ return PTR_ERR(info->cable.edev);
872873 }
873874
874875 if (acpi_dev_present(USB_HOST_EXTCON_HID, NULL, -1)) {
875876 info->otg.cable = extcon_get_extcon_dev(USB_HOST_EXTCON_NAME);
876− if (info->otg.cable == NULL) {
877− dev_dbg(dev, "EXTCON_USB_HOST is not ready, probe deferred\n");
878− return -EPROBE_DEFER;
877+ if (IS_ERR(info->otg.cable)) {
878+ dev_err_probe(dev, PTR_ERR(info->otg.cable),
879+ "extcon_get_extcon_dev(%s) failed\n",
880+ USB_HOST_EXTCON_NAME);
881+ return PTR_ERR(info->otg.cable);
879882 }
880883 dev_info(dev, "Using " USB_HOST_EXTCON_HID " extcon for usb-id\n");
881884 }
drivers/power/supply/charger-manager.c+2−5
@@ -985,13 +985,10 @@ static int charger_extcon_init(struct charger_manager *cm, · 984 unmodified lines
985985 cable->nb.notifier_call = charger_extcon_notifier;
986986
987987 cable->extcon_dev = extcon_get_extcon_dev(cable->extcon_name);
988− if (IS_ERR_OR_NULL(cable->extcon_dev)) {
988+ if (IS_ERR(cable->extcon_dev)) {
989989 pr_err("Cannot find extcon_dev for %s (cable: %s)\n",
990990 cable->extcon_name, cable->name);
991− if (cable->extcon_dev == NULL)
992− return -EPROBE_DEFER;
993− else
994− return PTR_ERR(cable->extcon_dev);
991+ return PTR_ERR(cable->extcon_dev);
995992 }
996993
997994 for (i = 0; i < ARRAY_SIZE(extcon_mapping); i++) {
drivers/power/supply/max8997_charger.c+4−4
@@ -242,10 +242,10 @@ static int max8997_battery_probe(struct platform_device *pdev) · 241 unmodified lines
242242 dev_info(&pdev->dev, "couldn't get charger regulator\n");
243243 }
244244 charger->edev = extcon_get_extcon_dev("max8997-muic");
245− if (IS_ERR_OR_NULL(charger->edev)) {
246− if (!charger->edev)
247− return -EPROBE_DEFER;
248− dev_info(charger->dev, "couldn't get extcon device\n");
245+ if (IS_ERR(charger->edev)) {
246+ dev_err_probe(charger->dev, PTR_ERR(charger->edev),
247+ "couldn't get extcon device: max8997-muic\n");
248+ return PTR_ERR(charger->edev);
249249 }
250250
251251 if (!IS_ERR(charger->reg) && !IS_ERR_OR_NULL(charger->edev)) {
drivers/usb/dwc3/drd.c+2−7
@@ -455,13 +455,8 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc) · 454 unmodified lines
455455 * This device property is for kernel internal use only and
456456 * is expected to be set by the glue code.
457457 */
458− if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) {
459− edev = extcon_get_extcon_dev(name);
460− if (!edev)
461− return ERR_PTR(-EPROBE_DEFER);
462−
463− return edev;
464− }
458+ if (device_property_read_string(dev, "linux,extcon-name", &name) == 0)
459+ return extcon_get_extcon_dev(name);
465460
466461 /*
467462 * Try to get an extcon device from the USB PHY controller's "port"
drivers/usb/phy/phy-omap-otg.c+2−2
@@ -95,8 +95,8 @@ static int omap_otg_probe(struct platform_device *pdev) · 94 unmodified lines
9595 return -ENODEV;
9696
9797 extcon = extcon_get_extcon_dev(config->extcon);
98− if (!extcon)
99− return -EPROBE_DEFER;
98+ if (IS_ERR(extcon))
99+ return PTR_ERR(extcon);
100100
101101 otg_dev = devm_kzalloc(&pdev->dev, sizeof(*otg_dev), GFP_KERNEL);
102102 if (!otg_dev)
drivers/usb/typec/tcpm/fusb302.c+2−2
@@ -1708,8 +1708,8 @@ static int fusb302_probe(struct i2c_client *client, · 1707 unmodified lines
17081708 */
17091709 if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) {
17101710 chip->extcon = extcon_get_extcon_dev(name);
1711− if (!chip->extcon)
1712− return -EPROBE_DEFER;
1711+ if (IS_ERR(chip->extcon))
1712+ return PTR_ERR(chip->extcon);
17131713 }
17141714
17151715 chip->vbus = devm_regulator_get(chip->dev, "vbus");
include/linux/extcon.h+1−1
@@ -296,7 +296,7 @@ static inline void devm_extcon_unregister_notifier_all(struct device *dev, · 295 unmodified lines
296296
297297 static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name)
298298 {
299− return ERR_PTR(-ENODEV);
299+ return NULL;
300300 }
301301
302302 static inline struct extcon_dev *extcon_find_edev_by_node(struct device_node *node)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t