Commit d4014a6b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'extcon-next-for-5.8' of...

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

Chanwoo writes:

Update extcon for v5.8

Detailed description for this pull request:
1. Update extcon provider driver
- Fix an error handling code by using devm_iio_channel_get() for extcon-adc-jac.c
- Fix the usage counter imbalance of runtime PM for extcon-arizona.c.
- Add proper dt-compatible string for extcon-max14577.c.

2. Update extcon core with minor updates:
- Remove unneeded initialization of local variable in extcon_register_notifier

* tag 'extcon-next-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon:
  extcon: arizona: Fix runtime PM imbalance on error
  extcon: max14577: Add proper dt-compatible strings
  extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()'
  extcon: remove redundant assignment to variable idx
parents 0cfcfb31 b2e5575a
...@@ -124,7 +124,7 @@ static int adc_jack_probe(struct platform_device *pdev) ...@@ -124,7 +124,7 @@ static int adc_jack_probe(struct platform_device *pdev)
for (i = 0; data->adc_conditions[i].id != EXTCON_NONE; i++); for (i = 0; data->adc_conditions[i].id != EXTCON_NONE; i++);
data->num_conditions = i; data->num_conditions = i;
data->chan = iio_channel_get(&pdev->dev, pdata->consumer_channel); data->chan = devm_iio_channel_get(&pdev->dev, pdata->consumer_channel);
if (IS_ERR(data->chan)) if (IS_ERR(data->chan))
return PTR_ERR(data->chan); return PTR_ERR(data->chan);
...@@ -164,7 +164,6 @@ static int adc_jack_remove(struct platform_device *pdev) ...@@ -164,7 +164,6 @@ static int adc_jack_remove(struct platform_device *pdev)
free_irq(data->irq, data); free_irq(data->irq, data);
cancel_work_sync(&data->handler.work); cancel_work_sync(&data->handler.work);
iio_channel_release(data->chan);
return 0; return 0;
} }
......
...@@ -1460,7 +1460,7 @@ static int arizona_extcon_probe(struct platform_device *pdev) ...@@ -1460,7 +1460,7 @@ static int arizona_extcon_probe(struct platform_device *pdev)
if (!info->input) { if (!info->input) {
dev_err(arizona->dev, "Can't allocate input dev\n"); dev_err(arizona->dev, "Can't allocate input dev\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_register; return ret;
} }
info->input->name = "Headset"; info->input->name = "Headset";
...@@ -1492,7 +1492,7 @@ static int arizona_extcon_probe(struct platform_device *pdev) ...@@ -1492,7 +1492,7 @@ static int arizona_extcon_probe(struct platform_device *pdev)
if (ret != 0) { if (ret != 0) {
dev_err(arizona->dev, "Failed to request GPIO%d: %d\n", dev_err(arizona->dev, "Failed to request GPIO%d: %d\n",
pdata->micd_pol_gpio, ret); pdata->micd_pol_gpio, ret);
goto err_register; return ret;
} }
info->micd_pol_gpio = gpio_to_desc(pdata->micd_pol_gpio); info->micd_pol_gpio = gpio_to_desc(pdata->micd_pol_gpio);
...@@ -1515,7 +1515,7 @@ static int arizona_extcon_probe(struct platform_device *pdev) ...@@ -1515,7 +1515,7 @@ static int arizona_extcon_probe(struct platform_device *pdev)
dev_err(arizona->dev, dev_err(arizona->dev,
"Failed to get microphone polarity GPIO: %d\n", "Failed to get microphone polarity GPIO: %d\n",
ret); ret);
goto err_register; return ret;
} }
} }
...@@ -1672,7 +1672,7 @@ static int arizona_extcon_probe(struct platform_device *pdev) ...@@ -1672,7 +1672,7 @@ static int arizona_extcon_probe(struct platform_device *pdev)
if (ret != 0) { if (ret != 0) {
dev_err(&pdev->dev, "Failed to get JACKDET rise IRQ: %d\n", dev_err(&pdev->dev, "Failed to get JACKDET rise IRQ: %d\n",
ret); ret);
goto err_gpio; goto err_pm;
} }
ret = arizona_set_irq_wake(arizona, jack_irq_rise, 1); ret = arizona_set_irq_wake(arizona, jack_irq_rise, 1);
...@@ -1721,14 +1721,14 @@ static int arizona_extcon_probe(struct platform_device *pdev) ...@@ -1721,14 +1721,14 @@ static int arizona_extcon_probe(struct platform_device *pdev)
dev_warn(arizona->dev, "Failed to set MICVDD to bypass: %d\n", dev_warn(arizona->dev, "Failed to set MICVDD to bypass: %d\n",
ret); ret);
pm_runtime_put(&pdev->dev);
ret = input_register_device(info->input); ret = input_register_device(info->input);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Can't register input device: %d\n", ret); dev_err(&pdev->dev, "Can't register input device: %d\n", ret);
goto err_hpdet; goto err_hpdet;
} }
pm_runtime_put(&pdev->dev);
return 0; return 0;
err_hpdet: err_hpdet:
...@@ -1743,10 +1743,11 @@ static int arizona_extcon_probe(struct platform_device *pdev) ...@@ -1743,10 +1743,11 @@ static int arizona_extcon_probe(struct platform_device *pdev)
arizona_set_irq_wake(arizona, jack_irq_rise, 0); arizona_set_irq_wake(arizona, jack_irq_rise, 0);
err_rise: err_rise:
arizona_free_irq(arizona, jack_irq_rise, info); arizona_free_irq(arizona, jack_irq_rise, info);
err_pm:
pm_runtime_put(&pdev->dev);
pm_runtime_disable(&pdev->dev);
err_gpio: err_gpio:
gpiod_put(info->micd_pol_gpio); gpiod_put(info->micd_pol_gpio);
err_register:
pm_runtime_disable(&pdev->dev);
return ret; return ret;
} }
......
...@@ -782,9 +782,19 @@ static const struct platform_device_id max14577_muic_id[] = { ...@@ -782,9 +782,19 @@ static const struct platform_device_id max14577_muic_id[] = {
}; };
MODULE_DEVICE_TABLE(platform, max14577_muic_id); MODULE_DEVICE_TABLE(platform, max14577_muic_id);
static const struct of_device_id of_max14577_muic_dt_match[] = {
{ .compatible = "maxim,max14577-muic",
.data = (void *)MAXIM_DEVICE_TYPE_MAX14577, },
{ .compatible = "maxim,max77836-muic",
.data = (void *)MAXIM_DEVICE_TYPE_MAX77836, },
{ },
};
MODULE_DEVICE_TABLE(of, of_max14577_muic_dt_match);
static struct platform_driver max14577_muic_driver = { static struct platform_driver max14577_muic_driver = {
.driver = { .driver = {
.name = "max14577-muic", .name = "max14577-muic",
.of_match_table = of_max14577_muic_dt_match,
}, },
.probe = max14577_muic_probe, .probe = max14577_muic_probe,
.remove = max14577_muic_remove, .remove = max14577_muic_remove,
......
...@@ -900,7 +900,7 @@ int extcon_register_notifier(struct extcon_dev *edev, unsigned int id, ...@@ -900,7 +900,7 @@ int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb) struct notifier_block *nb)
{ {
unsigned long flags; unsigned long flags;
int ret, idx = -EINVAL; int ret, idx;
if (!edev || !nb) if (!edev || !nb)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment