Skip to content

Commit 17129d4

Browse files
committed
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
2 parents 6e5c751 + 1f4be24 commit 17129d4

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

drivers/extcon/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ config EXTCON_PALMAS
115115

116116
config EXTCON_QCOM_SPMI_MISC
117117
tristate "Qualcomm USB extcon support"
118+
depends on ARCH_QCOM || COMPILE_TEST
118119
help
119120
Say Y here to enable SPMI PMIC based USB cable detection
120121
support on Qualcomm PMICs such as PM8941.

drivers/extcon/extcon-arizona.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,9 +1271,7 @@ static int arizona_extcon_get_micd_configs(struct device *dev,
12711271
goto out;
12721272

12731273
nconfs /= entries_per_config;
1274-
1275-
micd_configs = devm_kzalloc(dev,
1276-
nconfs * sizeof(struct arizona_micd_range),
1274+
micd_configs = devm_kcalloc(dev, nconfs, sizeof(*micd_configs),
12771275
GFP_KERNEL);
12781276
if (!micd_configs) {
12791277
ret = -ENOMEM;

drivers/extcon/extcon-intel-int3496.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ static int int3496_probe(struct platform_device *pdev)
9494
struct int3496_data *data;
9595
int ret;
9696

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

172-
acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
173-
174171
return 0;
175172
}
176173

drivers/extcon/extcon.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -964,12 +964,12 @@ EXPORT_SYMBOL_GPL(extcon_unregister_notifier);
964964

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

12541254
spin_lock_init(&edev->lock);
1255-
1256-
edev->nh = devm_kzalloc(&edev->dev,
1257-
sizeof(*edev->nh) * edev->max_supported, GFP_KERNEL);
1255+
edev->nh = devm_kcalloc(&edev->dev, edev->max_supported,
1256+
sizeof(*edev->nh), GFP_KERNEL);
12581257
if (!edev->nh) {
12591258
ret = -ENOMEM;
12601259
goto err_dev;

0 commit comments

Comments
 (0)