irqchip/irq-ts4800: 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: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20210908105708.1729-1-caihuoqing@baidu.com
This commit is contained in:
parent
bacdbd710d
commit
2687bf8d0d
@ -93,15 +93,13 @@ static int ts4800_ic_probe(struct platform_device *pdev)
|
|||||||
struct device_node *node = pdev->dev.of_node;
|
struct device_node *node = pdev->dev.of_node;
|
||||||
struct ts4800_irq_data *data;
|
struct ts4800_irq_data *data;
|
||||||
struct irq_chip *irq_chip;
|
struct irq_chip *irq_chip;
|
||||||
struct resource *res;
|
|
||||||
int parent_irq;
|
int parent_irq;
|
||||||
|
|
||||||
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
|
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
|
||||||
if (!data)
|
if (!data)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
data->base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
data->base = devm_ioremap_resource(&pdev->dev, res);
|
|
||||||
if (IS_ERR(data->base))
|
if (IS_ERR(data->base))
|
||||||
return PTR_ERR(data->base);
|
return PTR_ERR(data->base);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user