diff options
| author | Fabio Estevam <fabio.estevam@freescale.com> | 2013-11-05 14:21:22 -0500 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2013-11-06 04:51:24 -0500 |
| commit | 993571273275bfecb5161806796eb368db234106 (patch) | |
| tree | 6c14c8c0643a587fde123770aff49969580ddc4c | |
| parent | 8a24284275f682e3f92b0f91d7d06f2778bc4256 (diff) | |
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>
| -rw-r--r-- | drivers/gpio/gpio-mxs.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c index f8e6af20dfbf..532bcb336eff 100644 --- a/drivers/gpio/gpio-mxs.c +++ b/drivers/gpio/gpio-mxs.c | |||
| @@ -254,7 +254,6 @@ static int mxs_gpio_probe(struct platform_device *pdev) | |||
| 254 | struct device_node *parent; | 254 | struct device_node *parent; |
| 255 | static void __iomem *base; | 255 | static void __iomem *base; |
| 256 | struct mxs_gpio_port *port; | 256 | struct mxs_gpio_port *port; |
| 257 | struct resource *iores = NULL; | ||
| 258 | int irq_base; | 257 | int irq_base; |
| 259 | int err; | 258 | int err; |
| 260 | 259 | ||
| @@ -262,16 +261,10 @@ static int mxs_gpio_probe(struct platform_device *pdev) | |||
| 262 | if (!port) | 261 | if (!port) |
| 263 | return -ENOMEM; | 262 | return -ENOMEM; |
| 264 | 263 | ||
| 265 | if (np) { | 264 | port->id = of_alias_get_id(np, "gpio"); |
| 266 | port->id = of_alias_get_id(np, "gpio"); | 265 | if (port->id < 0) |
| 267 | if (port->id < 0) | 266 | return port->id; |
| 268 | return port->id; | 267 | port->devid = (enum mxs_gpio_id) of_id->data; |
| 269 | port->devid = (enum mxs_gpio_id) of_id->data; | ||
| 270 | } else { | ||
| 271 | port->id = pdev->id; | ||
| 272 | port->devid = pdev->id_entry->driver_data; | ||
| 273 | } | ||
| 274 | |||
| 275 | port->irq = platform_get_irq(pdev, 0); | 268 | port->irq = platform_get_irq(pdev, 0); |
| 276 | if (port->irq < 0) | 269 | if (port->irq < 0) |
| 277 | return port->irq; | 270 | return port->irq; |
| @@ -281,18 +274,11 @@ static int mxs_gpio_probe(struct platform_device *pdev) | |||
| 281 | * share the same one | 274 | * share the same one |
| 282 | */ | 275 | */ |
| 283 | if (!base) { | 276 | if (!base) { |
| 284 | if (np) { | 277 | parent = of_get_parent(np); |
| 285 | parent = of_get_parent(np); | 278 | base = of_iomap(parent, 0); |
| 286 | base = of_iomap(parent, 0); | 279 | of_node_put(parent); |
| 287 | of_node_put(parent); | 280 | if (!base) |
| 288 | if (!base) | 281 | return -EADDRNOTAVAIL; |
| 289 | return -EADDRNOTAVAIL; | ||
| 290 | } else { | ||
| 291 | iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 292 | base = devm_ioremap_resource(&pdev->dev, iores); | ||
| 293 | if (IS_ERR(base)) | ||
| 294 | return PTR_ERR(base); | ||
| 295 | } | ||
| 296 | } | 282 | } |
| 297 | port->base = base; | 283 | port->base = base; |
| 298 | 284 | ||
