Skip to contentSkip to conversation

media: i2c: imx290: Use device_property_read_u32() directly

PATCH Superseded Andy Shevchenko 2 participants 2 messages Feb 8, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: i2c: imx290: Use device_property_read_u32() directly

No need to call fwnode_property_read_u32(dev_fwnode()), when we have already existing helper. So use it.

---
 drivers/media/i2c/imx290.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/i2c/imx290.c +1 -2
index 330098a0772d..e7aa2ecdcc88 100644
@@ -1137,8 +1137,7 @@ static int imx290_init_clk(struct imx290 *imx290)
 	u32 xclk_freq;
 	int ret;
 
-	ret = fwnode_property_read_u32(dev_fwnode(imx290->dev),
-				       "clock-frequency", &xclk_freq);
+	ret = device_property_read_u32(imx290->dev, "clock-frequency", &xclk_freq);
 	if (ret) {
 		dev_err(imx290->dev, "Could not get xclk frequency\n");
 		return ret;
Signature · 1 line
2.39.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Andy,

Thank you for the patch.

Quoted 13 lines · Andy Shevchenko

No need to call fwnode_property_read_u32(dev_fwnode()), when we have already existing helper. So use it.

---
 drivers/media/i2c/imx290.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/i2c/imx290.c +0 -0
index 330098a0772d..e7aa2ecdcc88 100644

drivers/media/i2c/imx290.c static int imx290_init_clk(struct imx290 *imx290) · line 1140

Quoted 6 lines
drivers/media/i2c/imx290.c +1 -2
@@ -1137,8 +1137,7 @@ static int imx290_init_clk(struct imx290 *imx290)
 	u32 xclk_freq;
 	int ret;
 
-	ret = fwnode_property_read_u32(dev_fwnode(imx290->dev),
-				       "clock-frequency", &xclk_freq);
+	ret = device_property_read_u32(imx290->dev, "clock-frequency", &xclk_freq);

I'd break the line here.

Quoted 3 lines
drivers/media/i2c/imx290.c +0 -0
 	if (ret) {
 		dev_err(imx290->dev, "Could not get xclk frequency\n");
 		return ret;
Signature · 3 lines
Regards,

Laurent Pinchart