diff options
Diffstat (limited to 'drivers/gpio/gpio-max730x.c')
-rw-r--r-- | drivers/gpio/gpio-max730x.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpio/gpio-max730x.c b/drivers/gpio/gpio-max730x.c index 05e2dac60b3..00092342b84 100644 --- a/drivers/gpio/gpio-max730x.c +++ b/drivers/gpio/gpio-max730x.c @@ -160,17 +160,13 @@ static void max7301_set(struct gpio_chip *chip, unsigned offset, int value) mutex_unlock(&ts->lock); } -int __devinit __max730x_probe(struct max7301 *ts) +int __max730x_probe(struct max7301 *ts) { struct device *dev = ts->dev; struct max7301_platform_data *pdata; int i, ret; pdata = dev->platform_data; - if (!pdata || !pdata->base) { - dev_err(dev, "incorrect or missing platform data\n"); - return -EINVAL; - } mutex_init(&ts->lock); dev_set_drvdata(dev, ts); @@ -178,7 +174,12 @@ int __devinit __max730x_probe(struct max7301 *ts) /* Power up the chip and disable IRQ output */ ts->write(dev, 0x04, 0x01); - ts->input_pullup_active = pdata->input_pullup_active; + if (pdata) { + ts->input_pullup_active = pdata->input_pullup_active; + ts->chip.base = pdata->base; + } else { + ts->chip.base = -1; + } ts->chip.label = dev->driver->name; ts->chip.direction_input = max7301_direction_input; @@ -186,7 +187,6 @@ int __devinit __max730x_probe(struct max7301 *ts) ts->chip.direction_output = max7301_direction_output; ts->chip.set = max7301_set; - ts->chip.base = pdata->base; ts->chip.ngpio = PIN_NUMBER; ts->chip.can_sleep = 1; ts->chip.dev = dev; @@ -226,7 +226,7 @@ exit_destroy: } EXPORT_SYMBOL_GPL(__max730x_probe); -int __devexit __max730x_remove(struct device *dev) +int __max730x_remove(struct device *dev) { struct max7301 *ts = dev_get_drvdata(dev); int ret; |