adt7475.c (5c68005083d620b1499fc81926a514d39ae8b88c) | adt7475.c (6a01a12d7e1609defa9a025e22e8730008a62104) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * adt7475 - Thermal sensor driver for the ADT7475 chip and derivatives 4 * Copyright (C) 2007-2008, Advanced Micro Devices, Inc. 5 * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> 6 * Copyright (C) 2008 Hans de Goede <hdegoede@redhat.com> 7 * Copyright (C) 2009 Jean Delvare <jdelvare@suse.de> 8 * --- 1454 unchanged lines hidden (view full) --- 1463} 1464 1465static int load_config3(const struct i2c_client *client, const char *propname) 1466{ 1467 const char *function; 1468 u8 config3; 1469 int ret; 1470 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * adt7475 - Thermal sensor driver for the ADT7475 chip and derivatives 4 * Copyright (C) 2007-2008, Advanced Micro Devices, Inc. 5 * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net> 6 * Copyright (C) 2008 Hans de Goede <hdegoede@redhat.com> 7 * Copyright (C) 2009 Jean Delvare <jdelvare@suse.de> 8 * --- 1454 unchanged lines hidden (view full) --- 1463} 1464 1465static int load_config3(const struct i2c_client *client, const char *propname) 1466{ 1467 const char *function; 1468 u8 config3; 1469 int ret; 1470 |
1471 ret = of_property_read_string(client->dev.of_node, propname, &function); | 1471 ret = device_property_read_string(&client->dev, propname, &function); |
1472 if (!ret) { 1473 ret = adt7475_read(REG_CONFIG3); 1474 if (ret < 0) 1475 return ret; 1476 1477 config3 = ret & ~CONFIG3_SMBALERT; 1478 if (!strcmp("pwm2", function)) 1479 ; --- 9 unchanged lines hidden (view full) --- 1489} 1490 1491static int load_config4(const struct i2c_client *client, const char *propname) 1492{ 1493 const char *function; 1494 u8 config4; 1495 int ret; 1496 | 1472 if (!ret) { 1473 ret = adt7475_read(REG_CONFIG3); 1474 if (ret < 0) 1475 return ret; 1476 1477 config3 = ret & ~CONFIG3_SMBALERT; 1478 if (!strcmp("pwm2", function)) 1479 ; --- 9 unchanged lines hidden (view full) --- 1489} 1490 1491static int load_config4(const struct i2c_client *client, const char *propname) 1492{ 1493 const char *function; 1494 u8 config4; 1495 int ret; 1496 |
1497 ret = of_property_read_string(client->dev.of_node, propname, &function); | 1497 ret = device_property_read_string(&client->dev, propname, &function); |
1498 if (!ret) { 1499 ret = adt7475_read(REG_CONFIG4); 1500 if (ret < 0) 1501 return ret; 1502 1503 config4 = ret & ~CONFIG4_PINFUNC; 1504 1505 if (!strcmp("tach4", function)) --- 45 unchanged lines hidden (view full) --- 1551 1552 return 0; 1553} 1554 1555static int set_property_bit(const struct i2c_client *client, char *property, 1556 u8 *config, u8 bit_index) 1557{ 1558 u32 prop_value = 0; | 1498 if (!ret) { 1499 ret = adt7475_read(REG_CONFIG4); 1500 if (ret < 0) 1501 return ret; 1502 1503 config4 = ret & ~CONFIG4_PINFUNC; 1504 1505 if (!strcmp("tach4", function)) --- 45 unchanged lines hidden (view full) --- 1551 1552 return 0; 1553} 1554 1555static int set_property_bit(const struct i2c_client *client, char *property, 1556 u8 *config, u8 bit_index) 1557{ 1558 u32 prop_value = 0; |
1559 int ret = of_property_read_u32(client->dev.of_node, property, 1560 &prop_value); | 1559 int ret = device_property_read_u32(&client->dev, property, 1560 &prop_value); |
1561 1562 if (!ret) { 1563 if (prop_value) 1564 *config |= (1 << bit_index); 1565 else 1566 *config &= ~(1 << bit_index); 1567 } 1568 --- 454 unchanged lines hidden --- | 1561 1562 if (!ret) { 1563 if (prop_value) 1564 *config |= (1 << bit_index); 1565 else 1566 *config &= ~(1 << bit_index); 1567 } 1568 --- 454 unchanged lines hidden --- |