Skip to contentSkip to conversation

gpio: ts4900: use generic device properties

PATCH Applied Bartosz Golaszewski 2 participants 3 messages Oct 7, 2024 – Oct 14, 2024 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: ts4900: use generic device properties

From: Bartosz Golaszewski <[email protected]>

There's no reason to use OF-specific variants of property getters. Switch to using the preferred, generic device property helpers.

---
 drivers/gpio/gpio-ts4900.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpio/gpio-ts4900.c +3 -3
index 0f6397b77c9d..5c806140fdf0 100644
@@ -8,8 +8,8 @@
 
 #include <linux/gpio/driver.h>
 #include <linux/i2c.h>
-#include <linux/of.h>
 #include <linux/module.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 
 #define DEFAULT_PIN_NUMBER	32
@@ -142,7 +142,7 @@ static int ts4900_gpio_probe(struct i2c_client *client)
 	u32 ngpio;
 	int ret;
 
-	if (of_property_read_u32(client->dev.of_node, "ngpios", &ngpio))
+	if (device_property_read_u32(&client->dev, "ngpios", &ngpio))
 		ngpio = DEFAULT_PIN_NUMBER;
 
 	priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
@@ -153,7 +153,7 @@ static int ts4900_gpio_probe(struct i2c_client *client)
 	priv->gpio_chip.label = "ts4900-gpio";
 	priv->gpio_chip.ngpio = ngpio;
 	priv->gpio_chip.parent = &client->dev;
-	priv->input_bit = (uintptr_t)of_device_get_match_data(&client->dev);
+	priv->input_bit = (uintptr_t)device_get_match_data(&client->dev);
 
 	priv->regmap = devm_regmap_init_i2c(client, &ts4900_regmap_config);
 	if (IS_ERR(priv->regmap)) {
Signature · 1 line
2.43.0
author Applied
#2 lore raw
In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Quoted 4 lines · Bartosz Golaszewski

There's no reason to use OF-specific variants of property getters. Switch to using the preferred, generic device property helpers.

Applied, thanks!

[1/1] gpio: ts4900: use generic device properties

      commit: 16de489e3a3009e027a86858bfd645126d391502

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>