History

Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang: "Three driver bugfixes: fixing uninitialized memory pointers (eg20t), pm/clock imbalance (qup), and a wrongly set cached variable (pc954x)" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: qup: skip qup_i2c_suspend if the device is already runtime suspended i2c: mux: pca954x: retry updating the mux selection on failure i2c-eg20t: fix race between i2c init and interrupt enable

Linus Torvalds committed 10 years ago

Commit bd5dbcb2 parents d0c1d15 331dcf43 files · +14 −9Browse files

Unified · Split

3 files
  1. drivers/i2c/busses/i2c-eg20t.c +11 −7
  2. drivers/i2c/busses/i2c-qup.c +2 −1
  3. drivers/i2c/muxes/i2c-mux-pca954x.c +1 −1
drivers/i2c/busses/i2c-eg20t.c+11−7
@@ -773,13 +773,6 @@ static int pch_i2c_probe(struct pci_dev *pdev, · 772 unmodified lines
773773 /* Set the number of I2C channel instance */
774774 adap_info->ch_num = id->driver_data;
775775
776− ret = request_irq(pdev->irq, pch_i2c_handler, IRQF_SHARED,
777− KBUILD_MODNAME, adap_info);
778− if (ret) {
779− pch_pci_err(pdev, "request_irq FAILED\n");
780− goto err_request_irq;
781− }
782−
783776 for (i = 0; i < adap_info->ch_num; i++) {
784777 pch_adap = &adap_info->pch_data[i].pch_adapter;
785778 adap_info->pch_i2c_suspended = false;
@@ -797,6 +790,17 @@ static int pch_i2c_probe(struct pci_dev *pdev, · 11 unmodified lines
797790
798791 pch_adap->dev.of_node = pdev->dev.of_node;
799792 pch_adap->dev.parent = &pdev->dev;
793+ }
794+
795+ ret = request_irq(pdev->irq, pch_i2c_handler, IRQF_SHARED,
796+ KBUILD_MODNAME, adap_info);
797+ if (ret) {
798+ pch_pci_err(pdev, "request_irq FAILED\n");
799+ goto err_request_irq;
800+ }
801+
802+ for (i = 0; i < adap_info->ch_num; i++) {
803+ pch_adap = &adap_info->pch_data[i].pch_adapter;
800804
801805 pch_i2c_init(&adap_info->pch_data[i]);
802806
drivers/i2c/busses/i2c-qup.c+2−1
@@ -1599,7 +1599,8 @@ static int qup_i2c_pm_resume_runtime(struct device *device) · 1598 unmodified lines
15991599 #ifdef CONFIG_PM_SLEEP
16001600 static int qup_i2c_suspend(struct device *device)
16011601 {
1602− qup_i2c_pm_suspend_runtime(device);
1602+ if (!pm_runtime_suspended(device))
1603+ return qup_i2c_pm_suspend_runtime(device);
16031604 return 0;
16041605 }
16051606
drivers/i2c/muxes/i2c-mux-pca954x.c+1−1
@@ -164,7 +164,7 @@ static int pca954x_select_chan(struct i2c_mux_core *muxc, u32 chan) · 163 unmodified lines
164164 /* Only select the channel if its different from the last channel */
165165 if (data->last_chan != regval) {
166166 ret = pca954x_reg_write(muxc->parent, client, regval);
167− data->last_chan = regval;
167+ data->last_chan = ret ? 0 : regval;
168168 }
169169
170170 return ret;