mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-11 22:56:40 +07:00
gpio: xgene-sb: Tidy up fwnode usage
Since f94277af03
("of/platform: Initialise dev->fwnode appropriately"),
of_platform_device_create() already initialises dev->fwnode to that of
the appropriate device_node, so within the driver we shouldn't need to
care whether we probed via DT or ACPI.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
2bd6bf03f4
commit
aa5c2a88bb
@ -130,10 +130,7 @@ static int xgene_gpio_sb_to_irq(struct gpio_chip *gc, u32 gpio)
|
|||||||
(gpio > HWIRQ_TO_GPIO(priv, priv->nirq)))
|
(gpio > HWIRQ_TO_GPIO(priv, priv->nirq)))
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
|
||||||
if (gc->parent->of_node)
|
fwspec.fwnode = gc->parent->fwnode;
|
||||||
fwspec.fwnode = of_node_to_fwnode(gc->parent->of_node);
|
|
||||||
else
|
|
||||||
fwspec.fwnode = gc->parent->fwnode;
|
|
||||||
fwspec.param_count = 2;
|
fwspec.param_count = 2;
|
||||||
fwspec.param[0] = GPIO_TO_HWIRQ(priv, gpio);
|
fwspec.param[0] = GPIO_TO_HWIRQ(priv, gpio);
|
||||||
fwspec.param[1] = IRQ_TYPE_NONE;
|
fwspec.param[1] = IRQ_TYPE_NONE;
|
||||||
@ -231,7 +228,6 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)
|
|||||||
struct resource *res;
|
struct resource *res;
|
||||||
void __iomem *regs;
|
void __iomem *regs;
|
||||||
struct irq_domain *parent_domain = NULL;
|
struct irq_domain *parent_domain = NULL;
|
||||||
struct fwnode_handle *fwnode;
|
|
||||||
u32 val32;
|
u32 val32;
|
||||||
|
|
||||||
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
|
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
|
||||||
@ -285,13 +281,8 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
platform_set_drvdata(pdev, priv);
|
platform_set_drvdata(pdev, priv);
|
||||||
|
|
||||||
if (pdev->dev.of_node)
|
|
||||||
fwnode = of_node_to_fwnode(pdev->dev.of_node);
|
|
||||||
else
|
|
||||||
fwnode = pdev->dev.fwnode;
|
|
||||||
|
|
||||||
priv->irq_domain = irq_domain_create_hierarchy(parent_domain,
|
priv->irq_domain = irq_domain_create_hierarchy(parent_domain,
|
||||||
0, priv->nirq, fwnode,
|
0, priv->nirq, pdev->dev.fwnode,
|
||||||
&xgene_gpio_sb_domain_ops, priv);
|
&xgene_gpio_sb_domain_ops, priv);
|
||||||
if (!priv->irq_domain)
|
if (!priv->irq_domain)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
Loading…
Reference in New Issue
Block a user