From 03dcc544bff9ff36b9ac5e2b992a7a4890e6edc4 Mon Sep 17 00:00:00 2001 From: Chao Xie Date: Fri, 14 Jun 2013 01:21:51 -0400 Subject: mfd: 88pm80x: Change chip id definition and detection Change the chip id definition and detection and then: 1. We no longer need to add PM800_CHIP_XXX for the coming revision. 2. We no longer need to pass driver_data in i2c_device_id as we can distinguish the chips from the CHIP_ID register. Signed-off-by: Chao Xie Signed-off-by: Samuel Ortiz --- drivers/mfd/88pm805.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'drivers/mfd/88pm805.c') diff --git a/drivers/mfd/88pm805.c b/drivers/mfd/88pm805.c index 0e82c2a1e842..521602231c7b 100644 --- a/drivers/mfd/88pm805.c +++ b/drivers/mfd/88pm805.c @@ -29,10 +29,8 @@ #include #include -#define PM805_CHIP_ID (0x00) - static const struct i2c_device_id pm80x_id_table[] = { - {"88PM805", CHIP_PM805}, + {"88PM805", 0}, {} /* NULL terminated */ }; MODULE_DEVICE_TABLE(i2c, pm80x_id_table); @@ -192,7 +190,6 @@ static struct regmap_irq_chip pm805_irq_chip = { static int device_805_init(struct pm80x_chip *chip) { int ret = 0; - unsigned int val; struct regmap *map = chip->regmap; if (!map) { @@ -200,13 +197,6 @@ static int device_805_init(struct pm80x_chip *chip) return -EINVAL; } - ret = regmap_read(map, PM805_CHIP_ID, &val); - if (ret < 0) { - dev_err(chip->dev, "Failed to read CHIP ID: %d\n", ret); - goto out_irq_init; - } - chip->version = val; - chip->regmap_irq_chip = &pm805_irq_chip; ret = device_irq_init_805(chip); @@ -239,7 +229,7 @@ static int pm805_probe(struct i2c_client *client, struct pm80x_chip *chip; struct pm80x_platform_data *pdata = client->dev.platform_data; - ret = pm80x_init(client, id); + ret = pm80x_init(client); if (ret) { dev_err(&client->dev, "pm805_init fail!\n"); goto out_init; @@ -249,7 +239,7 @@ static int pm805_probe(struct i2c_client *client, ret = device_805_init(chip); if (ret) { - dev_err(chip->dev, "%s id 0x%x failed!\n", __func__, chip->id); + dev_err(chip->dev, "Failed to initialize 88pm805 devices\n"); goto err_805_init; } -- cgit v1.2.1