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
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZTKotAAoJEJzN3yze689TTfcQANGtVOymC+jCceNbTDHYjqaH
 7n55BRVA+U49mL7zuuKTh3OVKBLntEi/hFBDNnRV1Lkbcm1XIHdqDl5Vj15Lq7G+
 DXQZLo659os2kKxTbOfVZTjxy2jkh4RLPkIrCVy7fmIBaC3tKucK0F03V/CVvaPO
 Imss5WuN+h4H+WJpFqB+YWRGPqTvlPwbyffibtgWQcL1O//vdG0pDCjSJm55/YYI
 m1hoHWVXK8LXoOQiqohDRqmbzWjep6QYkhABBjR0/OV/E2I3PDqbItOEkhB//IPT
 eNyODZesp28ONA2ckBoVWu4by7gGHGJFIncNqUTwg+yLTjDjlK9QsRZf6YpGtQ0u
 yjylE0FQEn6Si+ln8AzYURqwfS5/ToDJzyE4Krzub09f+7CBScnJGLDIfuTjSvB9
 Xq0o5xP9qCAHF616vWlgdC5lfopyHQWra3HAu3dBxgNApj4UxIV4C1V1quuSPXLz
 A0uMeb8e2Nz/CqYValpinOeQigpSlRBc41wG7zN7gnLzoszG+y8FzCD1MEJUtoJ8
 qbbShWJwLMThMBS3TtfheqnPKWQX2JrJr6M5nChE16a3N5jivcjf86CBLuQTTjM5
 GTqpK6tjEs0IMckMuil5/pwi0yEWkxw6vLDOsBaFKYg/d1lwyg0ZSn/K6aRkPaMl
 4DBANhwN0DYvLwpsO9fj
 =U379
 -----END PGP SIGNATURE-----

Merge tag 'extcon-next-for-4.13' of git://git.kernel.org/pub/scm/linux/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
This commit is contained in:
Greg Kroah-Hartman 2017-06-27 17:37:15 +02:00
commit 17129d4702
4 changed files with 8 additions and 13 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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;
@ -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;
}

View File

@ -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
@ -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;