Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: sky81452: Use devm_mfd_add_devices() for mfd_device registration

Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.
CC: Gyungoh Yoo <jack.yoo@skyworksinc.com>

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Laxman Dewangan and committed by
Lee Jones
69633bea 6b719eba

+2 -8
+2 -8
drivers/mfd/sky81452.c
··· 64 64 cells[1].platform_data = pdata->regulator_init_data; 65 65 cells[1].pdata_size = sizeof(*pdata->regulator_init_data); 66 66 67 - ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL); 67 + ret = devm_mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), 68 + NULL, 0, NULL); 68 69 if (ret) 69 70 dev_err(dev, "failed to add child devices. err=%d\n", ret); 70 71 71 72 return ret; 72 - } 73 - 74 - static int sky81452_remove(struct i2c_client *client) 75 - { 76 - mfd_remove_devices(&client->dev); 77 - return 0; 78 73 } 79 74 80 75 static const struct i2c_device_id sky81452_ids[] = { ··· 92 97 .of_match_table = of_match_ptr(sky81452_of_match), 93 98 }, 94 99 .probe = sky81452_probe, 95 - .remove = sky81452_remove, 96 100 .id_table = sky81452_ids, 97 101 }; 98 102