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

mfd: rt5033: 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: Ingi Kim <ingi2.kim@samsung.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Laxman Dewangan and committed by
Lee Jones
6b719eba f41206c9

+3 -11
+3 -11
drivers/mfd/rt5033.c
··· 97 97 return ret; 98 98 } 99 99 100 - ret = mfd_add_devices(rt5033->dev, -1, rt5033_devs, 101 - ARRAY_SIZE(rt5033_devs), NULL, 0, 102 - regmap_irq_get_domain(rt5033->irq_data)); 100 + ret = devm_mfd_add_devices(rt5033->dev, -1, rt5033_devs, 101 + ARRAY_SIZE(rt5033_devs), NULL, 0, 102 + regmap_irq_get_domain(rt5033->irq_data)); 103 103 if (ret < 0) { 104 104 dev_err(&i2c->dev, "Failed to add RT5033 child devices.\n"); 105 105 return ret; 106 106 } 107 107 108 108 device_init_wakeup(rt5033->dev, rt5033->wakeup); 109 - 110 - return 0; 111 - } 112 - 113 - static int rt5033_i2c_remove(struct i2c_client *i2c) 114 - { 115 - mfd_remove_devices(&i2c->dev); 116 109 117 110 return 0; 118 111 } ··· 128 135 .of_match_table = of_match_ptr(rt5033_dt_match), 129 136 }, 130 137 .probe = rt5033_i2c_probe, 131 - .remove = rt5033_i2c_remove, 132 138 .id_table = rt5033_i2c_id, 133 139 }; 134 140 module_i2c_driver(rt5033_driver);