diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-15 17:03:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-15 17:03:17 -0500 |
commit | fe9d1159b299642f9e1a9b56bbf67a24c31bb418 (patch) | |
tree | 530c6e41beb784adb16a1faae2839edbad2fbb7f /drivers | |
parent | e5c13537b0153010b4f65b9c55faa78a4c151c93 (diff) | |
parent | 2236baa75f704851d3cd3310569058151acb1f06 (diff) |
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
i2c: Sanity checks on adapter registration
i2c: Mark i2c_adapter.id as deprecated
i2c: Drivers shouldn't include <linux/i2c-id.h>
i2c: Delete unused adapter IDs
i2c: Remove obsolete cleanup for clientdata
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/i2c-core.c | 12 | ||||
-rw-r--r-- | drivers/i2c/i2c-mux.c | 1 | ||||
-rw-r--r-- | drivers/media/common/saa7146_i2c.c | 1 | ||||
-rw-r--r-- | drivers/media/video/imx074.c | 2 | ||||
-rw-r--r-- | drivers/media/video/ir-kbd-i2c.c | 1 | ||||
-rw-r--r-- | drivers/media/video/ov6650.c | 2 | ||||
-rw-r--r-- | drivers/misc/apds9802als.c | 1 | ||||
-rw-r--r-- | drivers/staging/olpc_dcon/olpc_dcon.c | 4 | ||||
-rw-r--r-- | drivers/video/riva/rivafb-i2c.c | 1 |
9 files changed, 12 insertions, 13 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index d231f683f576..6b4cc567645b 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -848,6 +848,18 @@ static int i2c_register_adapter(struct i2c_adapter *adap) | |||
848 | goto out_list; | 848 | goto out_list; |
849 | } | 849 | } |
850 | 850 | ||
851 | /* Sanity checks */ | ||
852 | if (unlikely(adap->name[0] == '\0')) { | ||
853 | pr_err("i2c-core: Attempt to register an adapter with " | ||
854 | "no name!\n"); | ||
855 | return -EINVAL; | ||
856 | } | ||
857 | if (unlikely(!adap->algo)) { | ||
858 | pr_err("i2c-core: Attempt to register adapter '%s' with " | ||
859 | "no algo!\n", adap->name); | ||
860 | return -EINVAL; | ||
861 | } | ||
862 | |||
851 | rt_mutex_init(&adap->bus_lock); | 863 | rt_mutex_init(&adap->bus_lock); |
852 | mutex_init(&adap->userspace_clients_lock); | 864 | mutex_init(&adap->userspace_clients_lock); |
853 | INIT_LIST_HEAD(&adap->userspace_clients); | 865 | INIT_LIST_HEAD(&adap->userspace_clients); |
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index d32a4843fc3a..d7a4833be416 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c | |||
@@ -120,7 +120,6 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent, | |||
120 | snprintf(priv->adap.name, sizeof(priv->adap.name), | 120 | snprintf(priv->adap.name, sizeof(priv->adap.name), |
121 | "i2c-%d-mux (chan_id %d)", i2c_adapter_id(parent), chan_id); | 121 | "i2c-%d-mux (chan_id %d)", i2c_adapter_id(parent), chan_id); |
122 | priv->adap.owner = THIS_MODULE; | 122 | priv->adap.owner = THIS_MODULE; |
123 | priv->adap.id = parent->id; | ||
124 | priv->adap.algo = &priv->algo; | 123 | priv->adap.algo = &priv->algo; |
125 | priv->adap.algo_data = priv; | 124 | priv->adap.algo_data = priv; |
126 | priv->adap.dev.parent = &parent->dev; | 125 | priv->adap.dev.parent = &parent->dev; |
diff --git a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c index 3d88542612ea..74ee172b5bc9 100644 --- a/drivers/media/common/saa7146_i2c.c +++ b/drivers/media/common/saa7146_i2c.c | |||
@@ -391,7 +391,6 @@ static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, in | |||
391 | 391 | ||
392 | /*****************************************************************************/ | 392 | /*****************************************************************************/ |
393 | /* i2c-adapter helper functions */ | 393 | /* i2c-adapter helper functions */ |
394 | #include <linux/i2c-id.h> | ||
395 | 394 | ||
396 | /* exported algorithm data */ | 395 | /* exported algorithm data */ |
397 | static struct i2c_algorithm saa7146_algo = { | 396 | static struct i2c_algorithm saa7146_algo = { |
diff --git a/drivers/media/video/imx074.c b/drivers/media/video/imx074.c index 380e459f899d..27b5dfdfbb93 100644 --- a/drivers/media/video/imx074.c +++ b/drivers/media/video/imx074.c | |||
@@ -451,7 +451,6 @@ static int imx074_probe(struct i2c_client *client, | |||
451 | ret = imx074_video_probe(icd, client); | 451 | ret = imx074_video_probe(icd, client); |
452 | if (ret < 0) { | 452 | if (ret < 0) { |
453 | icd->ops = NULL; | 453 | icd->ops = NULL; |
454 | i2c_set_clientdata(client, NULL); | ||
455 | kfree(priv); | 454 | kfree(priv); |
456 | return ret; | 455 | return ret; |
457 | } | 456 | } |
@@ -468,7 +467,6 @@ static int imx074_remove(struct i2c_client *client) | |||
468 | icd->ops = NULL; | 467 | icd->ops = NULL; |
469 | if (icl->free_bus) | 468 | if (icl->free_bus) |
470 | icl->free_bus(icl); | 469 | icl->free_bus(icl); |
471 | i2c_set_clientdata(client, NULL); | ||
472 | client->driver = NULL; | 470 | client->driver = NULL; |
473 | kfree(priv); | 471 | kfree(priv); |
474 | 472 | ||
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index 5a000c65ae98..ce4a75375909 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #include <linux/errno.h> | 44 | #include <linux/errno.h> |
45 | #include <linux/slab.h> | 45 | #include <linux/slab.h> |
46 | #include <linux/i2c.h> | 46 | #include <linux/i2c.h> |
47 | #include <linux/i2c-id.h> | ||
48 | #include <linux/workqueue.h> | 47 | #include <linux/workqueue.h> |
49 | 48 | ||
50 | #include <media/ir-core.h> | 49 | #include <media/ir-core.h> |
diff --git a/drivers/media/video/ov6650.c b/drivers/media/video/ov6650.c index 31f19373bbae..cf93de988068 100644 --- a/drivers/media/video/ov6650.c +++ b/drivers/media/video/ov6650.c | |||
@@ -1174,7 +1174,6 @@ static int ov6650_probe(struct i2c_client *client, | |||
1174 | 1174 | ||
1175 | if (ret) { | 1175 | if (ret) { |
1176 | icd->ops = NULL; | 1176 | icd->ops = NULL; |
1177 | i2c_set_clientdata(client, NULL); | ||
1178 | kfree(priv); | 1177 | kfree(priv); |
1179 | } | 1178 | } |
1180 | 1179 | ||
@@ -1185,7 +1184,6 @@ static int ov6650_remove(struct i2c_client *client) | |||
1185 | { | 1184 | { |
1186 | struct ov6650 *priv = to_ov6650(client); | 1185 | struct ov6650 *priv = to_ov6650(client); |
1187 | 1186 | ||
1188 | i2c_set_clientdata(client, NULL); | ||
1189 | kfree(priv); | 1187 | kfree(priv); |
1190 | return 0; | 1188 | return 0; |
1191 | } | 1189 | } |
diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index 0ed09358027e..644d4cd071cc 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c | |||
@@ -251,7 +251,6 @@ static int apds9802als_probe(struct i2c_client *client, | |||
251 | 251 | ||
252 | return res; | 252 | return res; |
253 | als_error1: | 253 | als_error1: |
254 | i2c_set_clientdata(client, NULL); | ||
255 | kfree(data); | 254 | kfree(data); |
256 | return res; | 255 | return res; |
257 | } | 256 | } |
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c index 75aa7a36307d..4ca45ec7fd84 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon.c +++ b/drivers/staging/olpc_dcon/olpc_dcon.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/console.h> | 17 | #include <linux/console.h> |
18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/i2c-id.h> | ||
21 | #include <linux/pci.h> | 20 | #include <linux/pci.h> |
22 | #include <linux/pci_ids.h> | 21 | #include <linux/pci_ids.h> |
23 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
@@ -733,7 +732,6 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
733 | edev: | 732 | edev: |
734 | platform_device_unregister(dcon_device); | 733 | platform_device_unregister(dcon_device); |
735 | dcon_device = NULL; | 734 | dcon_device = NULL; |
736 | i2c_set_clientdata(client, NULL); | ||
737 | eirq: | 735 | eirq: |
738 | free_irq(DCON_IRQ, &dcon_driver); | 736 | free_irq(DCON_IRQ, &dcon_driver); |
739 | einit: | 737 | einit: |
@@ -757,8 +755,6 @@ static int dcon_remove(struct i2c_client *client) | |||
757 | platform_device_unregister(dcon_device); | 755 | platform_device_unregister(dcon_device); |
758 | cancel_work_sync(&dcon_work); | 756 | cancel_work_sync(&dcon_work); |
759 | 757 | ||
760 | i2c_set_clientdata(client, NULL); | ||
761 | |||
762 | return 0; | 758 | return 0; |
763 | } | 759 | } |
764 | 760 | ||
diff --git a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c index a0e22ac483a3..167400e2a182 100644 --- a/drivers/video/riva/rivafb-i2c.c +++ b/drivers/video/riva/rivafb-i2c.c | |||
@@ -94,7 +94,6 @@ static int __devinit riva_setup_i2c_bus(struct riva_i2c_chan *chan, | |||
94 | 94 | ||
95 | strcpy(chan->adapter.name, name); | 95 | strcpy(chan->adapter.name, name); |
96 | chan->adapter.owner = THIS_MODULE; | 96 | chan->adapter.owner = THIS_MODULE; |
97 | chan->adapter.id = I2C_HW_B_RIVA; | ||
98 | chan->adapter.class = i2c_class; | 97 | chan->adapter.class = i2c_class; |
99 | chan->adapter.algo_data = &chan->algo; | 98 | chan->adapter.algo_data = &chan->algo; |
100 | chan->adapter.dev.parent = &chan->par->pdev->dev; | 99 | chan->adapter.dev.parent = &chan->par->pdev->dev; |