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

mailbox: sun6i: Make use of the helper function devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>

authored by

Cai Huoqing and committed by
Jassi Brar
f5e2eeb9 f3908ccc

+1 -8
+1 -8
drivers/mailbox/sun6i-msgbox.c
··· 197 197 struct device *dev = &pdev->dev; 198 198 struct mbox_chan *chans; 199 199 struct reset_control *reset; 200 - struct resource *res; 201 200 struct sun6i_msgbox *mbox; 202 201 int i, ret; 203 202 ··· 245 246 goto err_disable_unprepare; 246 247 } 247 248 248 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 249 - if (!res) { 250 - ret = -ENODEV; 251 - goto err_disable_unprepare; 252 - } 253 - 254 - mbox->regs = devm_ioremap_resource(&pdev->dev, res); 249 + mbox->regs = devm_platform_ioremap_resource(pdev, 0); 255 250 if (IS_ERR(mbox->regs)) { 256 251 ret = PTR_ERR(mbox->regs); 257 252 dev_err(dev, "Failed to map MMIO resource: %d\n", ret);