Skip to content

Commit e6815a0

Browse files
andy-shevBartosz Golaszewski
authored andcommitted
gpio: stmpe: Make use of device properties
Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240902133148.2569486-5-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 56f534d commit e6815a0

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/gpio/gpio-stmpe.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#include <linux/slab.h>
1212
#include <linux/gpio/driver.h>
1313
#include <linux/interrupt.h>
14-
#include <linux/of.h>
1514
#include <linux/mfd/stmpe.h>
15+
#include <linux/property.h>
1616
#include <linux/seq_file.h>
1717
#include <linux/bitops.h>
1818

@@ -465,7 +465,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
465465
{
466466
struct device *dev = &pdev->dev;
467467
struct stmpe *stmpe = dev_get_drvdata(dev->parent);
468-
struct device_node *np = dev->of_node;
469468
struct stmpe_gpio *stmpe_gpio;
470469
int ret, irq;
471470

@@ -489,8 +488,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
489488
if (IS_ENABLED(CONFIG_DEBUG_FS))
490489
stmpe_gpio->chip.dbg_show = stmpe_dbg_show;
491490

492-
of_property_read_u32(np, "st,norequest-mask",
493-
&stmpe_gpio->norequest_mask);
491+
device_property_read_u32(dev, "st,norequest-mask", &stmpe_gpio->norequest_mask);
494492

495493
ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO);
496494
if (ret)

0 commit comments

Comments
 (0)