Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
[firefly-linux-kernel-4.4.55.git] / drivers / gpio / gpio-max730x.c
index 05e2dac60b3b83e2974b718c6a72db3aa90efc3b..00092342b84c050d0c1d0e32b9202919108aa11a 100644 (file)
@@ -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;