diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-07-04 11:47:45 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-07-28 10:26:21 +0200 |
commit | 7a72f33b6771d37aafe1d396f8d49e5886e6262e (patch) | |
tree | 8f3299c76165800ec650ed781d772c97f3bd5dfa | |
parent | leds: aw200xx: Switch back to use struct i2c_driver::probe (diff) | |
download | linux-7a72f33b6771d37aafe1d396f8d49e5886e6262e.tar.xz linux-7a72f33b6771d37aafe1d396f8d49e5886e6262e.zip |
leds: ip30: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230704094745.25665-1-frank.li@vivo.com
Signed-off-by: Lee Jones <lee@kernel.org>
-rw-r--r-- | drivers/leds/leds-ip30.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/leds/leds-ip30.c b/drivers/leds/leds-ip30.c index 1f952bad0fe8..2df24c303366 100644 --- a/drivers/leds/leds-ip30.c +++ b/drivers/leds/leds-ip30.c @@ -27,22 +27,16 @@ static void ip30led_set(struct led_classdev *led_cdev, static int ip30led_create(struct platform_device *pdev, int num) { - struct resource *res; struct ip30_led *data; - res = platform_get_resource(pdev, IORESOURCE_MEM, num); - if (!res) - return -EBUSY; - data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; - data->reg = devm_ioremap_resource(&pdev->dev, res); + data->reg = devm_platform_ioremap_resource(pdev, num); if (IS_ERR(data->reg)) return PTR_ERR(data->reg); - switch (num) { case IP30_LED_SYSTEM: data->cdev.name = "white:power"; |