gpio: gpio-mxs: Remove unneeded dt checks
mxs is a devicetree only platform, so there is no need to check whether we are in dt or platform data case. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
8a24284275
commit
9935712732
@ -254,7 +254,6 @@ static int mxs_gpio_probe(struct platform_device *pdev)
|
|||||||
struct device_node *parent;
|
struct device_node *parent;
|
||||||
static void __iomem *base;
|
static void __iomem *base;
|
||||||
struct mxs_gpio_port *port;
|
struct mxs_gpio_port *port;
|
||||||
struct resource *iores = NULL;
|
|
||||||
int irq_base;
|
int irq_base;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@ -262,16 +261,10 @@ static int mxs_gpio_probe(struct platform_device *pdev)
|
|||||||
if (!port)
|
if (!port)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
if (np) {
|
port->id = of_alias_get_id(np, "gpio");
|
||||||
port->id = of_alias_get_id(np, "gpio");
|
if (port->id < 0)
|
||||||
if (port->id < 0)
|
return port->id;
|
||||||
return port->id;
|
port->devid = (enum mxs_gpio_id) of_id->data;
|
||||||
port->devid = (enum mxs_gpio_id) of_id->data;
|
|
||||||
} else {
|
|
||||||
port->id = pdev->id;
|
|
||||||
port->devid = pdev->id_entry->driver_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
port->irq = platform_get_irq(pdev, 0);
|
port->irq = platform_get_irq(pdev, 0);
|
||||||
if (port->irq < 0)
|
if (port->irq < 0)
|
||||||
return port->irq;
|
return port->irq;
|
||||||
@ -281,18 +274,11 @@ static int mxs_gpio_probe(struct platform_device *pdev)
|
|||||||
* share the same one
|
* share the same one
|
||||||
*/
|
*/
|
||||||
if (!base) {
|
if (!base) {
|
||||||
if (np) {
|
parent = of_get_parent(np);
|
||||||
parent = of_get_parent(np);
|
base = of_iomap(parent, 0);
|
||||||
base = of_iomap(parent, 0);
|
of_node_put(parent);
|
||||||
of_node_put(parent);
|
if (!base)
|
||||||
if (!base)
|
return -EADDRNOTAVAIL;
|
||||||
return -EADDRNOTAVAIL;
|
|
||||||
} else {
|
|
||||||
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
||||||
base = devm_ioremap_resource(&pdev->dev, iores);
|
|
||||||
if (IS_ERR(base))
|
|
||||||
return PTR_ERR(base);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
port->base = base;
|
port->base = base;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user