aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-max730x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-max730x.c')
-rw-r--r--drivers/gpio/gpio-max730x.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-max730x.c b/drivers/gpio/gpio-max730x.c
index 05e2dac60b3b..c4bf86abd4d8 100644
--- a/drivers/gpio/gpio-max730x.c
+++ b/drivers/gpio/gpio-max730x.c
@@ -167,10 +167,6 @@ int __devinit __max730x_probe(struct max7301 *ts)
167 int i, ret; 167 int i, ret;
168 168
169 pdata = dev->platform_data; 169 pdata = dev->platform_data;
170 if (!pdata || !pdata->base) {
171 dev_err(dev, "incorrect or missing platform data\n");
172 return -EINVAL;
173 }
174 170
175 mutex_init(&ts->lock); 171 mutex_init(&ts->lock);
176 dev_set_drvdata(dev, ts); 172 dev_set_drvdata(dev, ts);
@@ -178,7 +174,12 @@ int __devinit __max730x_probe(struct max7301 *ts)
178 /* Power up the chip and disable IRQ output */ 174 /* Power up the chip and disable IRQ output */
179 ts->write(dev, 0x04, 0x01); 175 ts->write(dev, 0x04, 0x01);
180 176
181 ts->input_pullup_active = pdata->input_pullup_active; 177 if (pdata) {
178 ts->input_pullup_active = pdata->input_pullup_active;
179 ts->chip.base = pdata->base;
180 } else {
181 ts->chip.base = -1;
182 }
182 ts->chip.label = dev->driver->name; 183 ts->chip.label = dev->driver->name;
183 184
184 ts->chip.direction_input = max7301_direction_input; 185 ts->chip.direction_input = max7301_direction_input;
@@ -186,7 +187,6 @@ int __devinit __max730x_probe(struct max7301 *ts)
186 ts->chip.direction_output = max7301_direction_output; 187 ts->chip.direction_output = max7301_direction_output;
187 ts->chip.set = max7301_set; 188 ts->chip.set = max7301_set;
188 189
189 ts->chip.base = pdata->base;
190 ts->chip.ngpio = PIN_NUMBER; 190 ts->chip.ngpio = PIN_NUMBER;
191 ts->chip.can_sleep = 1; 191 ts->chip.can_sleep = 1;
192 ts->chip.dev = dev; 192 ts->chip.dev = dev;