Skip to content

Commit

Permalink
Merge tag 'extcon-next-for-4.13' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/kernel/git/chanwoo/extcon into usb-next

Chanwoo writes:

Update extcon for 4.13

Detailed description for this pull request:
- Use devm_kcalloc() and fix typo for extcon core/extcon-arizona.c.
- Add dependency ARCH_QCOM for extcon-qcom-spmi-misc.c
- Use resource-managed devm_* function for gpios on extcon-int3496.c
  • Loading branch information
Greg Kroah-Hartman committed Jun 27, 2017
2 parents 6e5c751 + 1f4be24 commit 17129d4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
1 change: 1 addition & 0 deletions drivers/extcon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ config EXTCON_PALMAS

config EXTCON_QCOM_SPMI_MISC
tristate "Qualcomm USB extcon support"
depends on ARCH_QCOM || COMPILE_TEST
help
Say Y here to enable SPMI PMIC based USB cable detection
support on Qualcomm PMICs such as PM8941.
Expand Down
4 changes: 1 addition & 3 deletions drivers/extcon/extcon-arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,9 +1271,7 @@ static int arizona_extcon_get_micd_configs(struct device *dev,
goto out;

nconfs /= entries_per_config;

micd_configs = devm_kzalloc(dev,
nconfs * sizeof(struct arizona_micd_range),
micd_configs = devm_kcalloc(dev, nconfs, sizeof(*micd_configs),
GFP_KERNEL);
if (!micd_configs) {
ret = -ENOMEM;
Expand Down
5 changes: 1 addition & 4 deletions drivers/extcon/extcon-intel-int3496.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ static int int3496_probe(struct platform_device *pdev)
struct int3496_data *data;
int ret;

ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev),
acpi_int3496_default_gpios);
ret = devm_acpi_dev_add_driver_gpios(dev, acpi_int3496_default_gpios);
if (ret) {
dev_err(dev, "can't add GPIO ACPI mapping\n");
return ret;
Expand Down Expand Up @@ -169,8 +168,6 @@ static int int3496_remove(struct platform_device *pdev)
devm_free_irq(&pdev->dev, data->usb_id_irq, data);
cancel_delayed_work_sync(&data->work);

acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));

return 0;
}

Expand Down
11 changes: 5 additions & 6 deletions drivers/extcon/extcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,12 +964,12 @@ EXPORT_SYMBOL_GPL(extcon_unregister_notifier);

/**
* extcon_register_notifier_all() - Register a notifier block for all connectors
* @edev: the extcon device that has the external connecotr.
* @edev: the extcon device that has the external connector.
* @nb: a notifier block to be registered.
*
* This fucntion registers a notifier block in order to receive the state
* This function registers a notifier block in order to receive the state
* change of all supported external connectors from extcon device.
* And The second parameter given to the callback of nb (val) is
* And the second parameter given to the callback of nb (val) is
* the current state and third parameter is the edev pointer.
*
* Returns 0 if success or error number if fail
Expand Down Expand Up @@ -1252,9 +1252,8 @@ int extcon_dev_register(struct extcon_dev *edev)
}

spin_lock_init(&edev->lock);

edev->nh = devm_kzalloc(&edev->dev,
sizeof(*edev->nh) * edev->max_supported, GFP_KERNEL);
edev->nh = devm_kcalloc(&edev->dev, edev->max_supported,
sizeof(*edev->nh), GFP_KERNEL);
if (!edev->nh) {
ret = -ENOMEM;
goto err_dev;
Expand Down

0 comments on commit 17129d4

Please sign in to comment.