From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Sean Young <sean@mess.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Andi Shyti <andi.shyti@kernel.org>
Subject: [PATCH v1 2/5] media: ir-spi: Make use of device properties
Date: Tue, 5 Mar 2024 19:48:27 +0200 [thread overview]
Message-ID: <20240305174933.1370708-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20240305174933.1370708-1-andriy.shevchenko@linux.intel.com>
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>
---
drivers/media/rc/ir-spi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/rc/ir-spi.c b/drivers/media/rc/ir-spi.c
index 28437a35b7ba..846d407a1f7e 100644
--- a/drivers/media/rc/ir-spi.c
+++ b/drivers/media/rc/ir-spi.c
@@ -10,7 +10,7 @@
#include <linux/math.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
-#include <linux/of.h>
+#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/spi/spi.h>
#include <linux/string.h>
@@ -116,6 +116,7 @@ static int ir_spi_set_duty_cycle(struct rc_dev *dev, u32 duty_cycle)
static int ir_spi_probe(struct spi_device *spi)
{
+ struct device *dev = &spi->dev;
int ret;
u8 dc;
struct ir_spi_data *idata;
@@ -140,9 +141,8 @@ static int ir_spi_probe(struct spi_device *spi)
idata->rc->priv = idata;
idata->spi = spi;
- idata->negated = of_property_read_bool(spi->dev.of_node,
- "led-active-low");
- ret = of_property_read_u8(spi->dev.of_node, "duty-cycle", &dc);
+ idata->negated = device_property_read_bool(dev, "led-active-low");
+ ret = device_property_read_u8(dev, "duty-cycle", &dc);
if (ret)
dc = 50;
--
2.43.0.rc1.1.gbec44491f096
next prev parent reply other threads:[~2024-03-05 17:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-05 17:48 [PATCH v1 0/5] media: ir-spi: A few cleanups Andy Shevchenko
2024-03-05 17:48 ` [PATCH v1 1/5] media: ir-spi: Don't use "proxy" headers Andy Shevchenko
2024-03-05 22:44 ` [SPAM] " Andi Shyti
2024-03-05 17:48 ` Andy Shevchenko [this message]
2024-03-05 22:45 ` [SPAM] [PATCH v1 2/5] media: ir-spi: Make use of device properties Andi Shyti
2024-03-05 17:48 ` [PATCH v1 3/5] media: ir-spi: Utilise temporary variable for struct device Andy Shevchenko
2024-03-05 22:47 ` [SPAM] " Andi Shyti
2024-03-05 17:48 ` [PATCH v1 4/5] media: ir-spi: Remove trailing comma in the terminator entry Andy Shevchenko
2024-03-05 22:48 ` Andi Shyti
2024-03-05 17:48 ` [PATCH v1 5/5] media: ir-spi: Unify indentation and comment style Andy Shevchenko
2024-03-05 22:52 ` [SPAM] " Andi Shyti
2024-03-06 13:35 ` Andy Shevchenko
2024-03-08 12:37 ` Andi Shyti
2024-03-05 22:43 ` [PATCH v1 0/5] media: ir-spi: A few cleanups Andi Shyti
2024-03-11 14:25 ` Andy Shevchenko
2024-03-11 14:50 ` Sean Young
2024-03-11 14:50 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240305174933.1370708-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andi.shyti@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sean@mess.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.