7
7
8
8
#include <linux/gpio/driver.h>
9
9
#include <linux/i2c.h>
10
- #include <linux/platform_data/pcf857x.h>
11
10
#include <linux/interrupt.h>
12
11
#include <linux/irq.h>
13
12
#include <linux/irqdomain.h>
18
17
#include <linux/slab.h>
19
18
#include <linux/spinlock.h>
20
19
21
-
22
20
static const struct i2c_device_id pcf857x_id [] = {
23
21
{ "pcf8574" , 8 },
24
22
{ "pcf8574a" , 8 },
@@ -277,18 +275,12 @@ static const struct irq_chip pcf857x_irq_chip = {
277
275
static int pcf857x_probe (struct i2c_client * client )
278
276
{
279
277
const struct i2c_device_id * id = i2c_client_get_device_id (client );
280
- struct pcf857x_platform_data * pdata = dev_get_platdata (& client -> dev );
281
278
struct device_node * np = client -> dev .of_node ;
282
279
struct pcf857x * gpio ;
283
280
unsigned int n_latch = 0 ;
284
281
int status ;
285
282
286
- if (IS_ENABLED (CONFIG_OF ) && np )
287
- of_property_read_u32 (np , "lines-initial-states" , & n_latch );
288
- else if (pdata )
289
- n_latch = pdata -> n_latch ;
290
- else
291
- dev_dbg (& client -> dev , "no platform data\n" );
283
+ of_property_read_u32 (np , "lines-initial-states" , & n_latch );
292
284
293
285
/* Allocate, initialize, and register this gpio_chip. */
294
286
gpio = devm_kzalloc (& client -> dev , sizeof (* gpio ), GFP_KERNEL );
@@ -297,7 +289,7 @@ static int pcf857x_probe(struct i2c_client *client)
297
289
298
290
mutex_init (& gpio -> lock );
299
291
300
- gpio -> chip .base = pdata ? pdata -> gpio_base : -1 ;
292
+ gpio -> chip .base = -1 ;
301
293
gpio -> chip .can_sleep = true;
302
294
gpio -> chip .parent = & client -> dev ;
303
295
gpio -> chip .owner = THIS_MODULE ;
@@ -406,17 +398,6 @@ static int pcf857x_probe(struct i2c_client *client)
406
398
if (status < 0 )
407
399
goto fail ;
408
400
409
- /* Let platform code set up the GPIOs and their users.
410
- * Now is the first time anyone could use them.
411
- */
412
- if (pdata && pdata -> setup ) {
413
- status = pdata -> setup (client ,
414
- gpio -> chip .base , gpio -> chip .ngpio ,
415
- pdata -> context );
416
- if (status < 0 )
417
- dev_warn (& client -> dev , "setup --> %d\n" , status );
418
- }
419
-
420
401
dev_info (& client -> dev , "probed\n" );
421
402
422
403
return 0 ;
@@ -428,16 +409,6 @@ static int pcf857x_probe(struct i2c_client *client)
428
409
return status ;
429
410
}
430
411
431
- static void pcf857x_remove (struct i2c_client * client )
432
- {
433
- struct pcf857x_platform_data * pdata = dev_get_platdata (& client -> dev );
434
- struct pcf857x * gpio = i2c_get_clientdata (client );
435
-
436
- if (pdata && pdata -> teardown )
437
- pdata -> teardown (client , gpio -> chip .base , gpio -> chip .ngpio ,
438
- pdata -> context );
439
- }
440
-
441
412
static void pcf857x_shutdown (struct i2c_client * client )
442
413
{
443
414
struct pcf857x * gpio = i2c_get_clientdata (client );
@@ -452,7 +423,6 @@ static struct i2c_driver pcf857x_driver = {
452
423
.of_match_table = of_match_ptr (pcf857x_of_table ),
453
424
},
454
425
.probe_new = pcf857x_probe ,
455
- .remove = pcf857x_remove ,
456
426
.shutdown = pcf857x_shutdown ,
457
427
.id_table = pcf857x_id ,
458
428
};
0 commit comments