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

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>

authored by

Yangtao Li and committed by
Lee Jones
7a72f33b 07a476e0

+1 -7
+1 -7
drivers/leds/leds-ip30.c
··· 27 27 28 28 static int ip30led_create(struct platform_device *pdev, int num) 29 29 { 30 - struct resource *res; 31 30 struct ip30_led *data; 32 - 33 - res = platform_get_resource(pdev, IORESOURCE_MEM, num); 34 - if (!res) 35 - return -EBUSY; 36 31 37 32 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); 38 33 if (!data) 39 34 return -ENOMEM; 40 35 41 - data->reg = devm_ioremap_resource(&pdev->dev, res); 36 + data->reg = devm_platform_ioremap_resource(pdev, num); 42 37 if (IS_ERR(data->reg)) 43 38 return PTR_ERR(data->reg); 44 - 45 39 46 40 switch (num) { 47 41 case IP30_LED_SYSTEM: