Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull i2c fixes from Wolfram Sang:
"Two bugfixes for the AT24 I2C eeprom driver and some minor corrections
for I2C bus drivers"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: piix4: Fix port number check on release
i2c: stm32: Fix copyrights
i2c-cht-wc: constify platform_device_id
eeprom: at24: change nvmem stride to 1
eeprom: at24: fix I2C device selection for runtime PM

+19 -20
+1 -1
drivers/i2c/busses/i2c-cht-wc.c
··· 379 379 return 0; 380 380 } 381 381 382 - static struct platform_device_id cht_wc_i2c_adap_id_table[] = { 382 + static const struct platform_device_id cht_wc_i2c_adap_id_table[] = { 383 383 { .name = "cht_wcove_ext_chgr" }, 384 384 {}, 385 385 };
+1 -1
drivers/i2c/busses/i2c-piix4.c
··· 983 983 984 984 if (adapdata->smba) { 985 985 i2c_del_adapter(adap); 986 - if (adapdata->port == (0 << 1)) { 986 + if (adapdata->port == (0 << piix4_port_shift_sb800)) { 987 987 release_region(adapdata->smba, SMBIOSIZE); 988 988 if (adapdata->sb800_main) 989 989 release_region(SB800_PIIX4_SMB_IDX, 2);
+2 -1
drivers/i2c/busses/i2c-stm32.h
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * i2c-stm32.h 3 4 * 4 5 * Copyright (C) M'boumba Cedric Madianga 2017 6 + * Copyright (C) STMicroelectronics 2017 5 7 * Author: M'boumba Cedric Madianga <cedric.madianga@gmail.com> 6 8 * 7 - * License terms: GNU General Public License (GPL), version 2 8 9 */ 9 10 10 11 #ifndef _I2C_STM32_H
+2 -1
drivers/i2c/busses/i2c-stm32f4.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Driver for STMicroelectronics STM32 I2C controller 3 4 * ··· 7 6 * http://www.st.com/resource/en/reference_manual/DM00031020.pdf 8 7 * 9 8 * Copyright (C) M'boumba Cedric Madianga 2016 9 + * Copyright (C) STMicroelectronics 2017 10 10 * Author: M'boumba Cedric Madianga <cedric.madianga@gmail.com> 11 11 * 12 12 * This driver is based on i2c-st.c 13 13 * 14 - * License terms: GNU General Public License (GPL), version 2 15 14 */ 16 15 17 16 #include <linux/clk.h>
+2 -1
drivers/i2c/busses/i2c-stm32f7.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Driver for STMicroelectronics STM32F7 I2C controller 3 4 * ··· 8 7 * http://www.st.com/resource/en/reference_manual/dm00124865.pdf 9 8 * 10 9 * Copyright (C) M'boumba Cedric Madianga 2017 10 + * Copyright (C) STMicroelectronics 2017 11 11 * Author: M'boumba Cedric Madianga <cedric.madianga@gmail.com> 12 12 * 13 13 * This driver is based on i2c-stm32f4.c 14 14 * 15 - * License terms: GNU General Public License (GPL), version 2 16 15 */ 17 16 #include <linux/clk.h> 18 17 #include <linux/delay.h>
+11 -15
drivers/misc/eeprom/at24.c
··· 562 562 static int at24_read(void *priv, unsigned int off, void *val, size_t count) 563 563 { 564 564 struct at24_data *at24 = priv; 565 - struct i2c_client *client; 565 + struct device *dev = &at24->client[0]->dev; 566 566 char *buf = val; 567 567 int ret; 568 568 ··· 572 572 if (off + count > at24->chip.byte_len) 573 573 return -EINVAL; 574 574 575 - client = at24_translate_offset(at24, &off); 576 - 577 - ret = pm_runtime_get_sync(&client->dev); 575 + ret = pm_runtime_get_sync(dev); 578 576 if (ret < 0) { 579 - pm_runtime_put_noidle(&client->dev); 577 + pm_runtime_put_noidle(dev); 580 578 return ret; 581 579 } 582 580 ··· 590 592 status = at24->read_func(at24, buf, off, count); 591 593 if (status < 0) { 592 594 mutex_unlock(&at24->lock); 593 - pm_runtime_put(&client->dev); 595 + pm_runtime_put(dev); 594 596 return status; 595 597 } 596 598 buf += status; ··· 600 602 601 603 mutex_unlock(&at24->lock); 602 604 603 - pm_runtime_put(&client->dev); 605 + pm_runtime_put(dev); 604 606 605 607 return 0; 606 608 } ··· 608 610 static int at24_write(void *priv, unsigned int off, void *val, size_t count) 609 611 { 610 612 struct at24_data *at24 = priv; 611 - struct i2c_client *client; 613 + struct device *dev = &at24->client[0]->dev; 612 614 char *buf = val; 613 615 int ret; 614 616 ··· 618 620 if (off + count > at24->chip.byte_len) 619 621 return -EINVAL; 620 622 621 - client = at24_translate_offset(at24, &off); 622 - 623 - ret = pm_runtime_get_sync(&client->dev); 623 + ret = pm_runtime_get_sync(dev); 624 624 if (ret < 0) { 625 - pm_runtime_put_noidle(&client->dev); 625 + pm_runtime_put_noidle(dev); 626 626 return ret; 627 627 } 628 628 ··· 636 640 status = at24->write_func(at24, buf, off, count); 637 641 if (status < 0) { 638 642 mutex_unlock(&at24->lock); 639 - pm_runtime_put(&client->dev); 643 + pm_runtime_put(dev); 640 644 return status; 641 645 } 642 646 buf += status; ··· 646 650 647 651 mutex_unlock(&at24->lock); 648 652 649 - pm_runtime_put(&client->dev); 653 + pm_runtime_put(dev); 650 654 651 655 return 0; 652 656 } ··· 876 880 at24->nvmem_config.reg_read = at24_read; 877 881 at24->nvmem_config.reg_write = at24_write; 878 882 at24->nvmem_config.priv = at24; 879 - at24->nvmem_config.stride = 4; 883 + at24->nvmem_config.stride = 1; 880 884 at24->nvmem_config.word_size = 1; 881 885 at24->nvmem_config.size = chip.byte_len; 882 886