public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ov9282: Fix Smatch errors
@ 2022-11-28 16:22 Dave Stevenson
  2022-11-28 16:22 ` [PATCH 1/3] media: i2c: ov9282: Fix missing documentation in structures Dave Stevenson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dave Stevenson @ 2022-11-28 16:22 UTC (permalink / raw)
  To: Paul J. Murphy, Daniele Alessandrelli, Sakari Ailus, linux-media
  Cc: Dave Stevenson

This serires fixes up smatch errors from the recent patches for ov9282.

Dave Stevenson (3):
  media: i2c: ov9282: Fix missing documentation in structures
  media: i2c: ov9282: Make common_regs_list static
  media: i2c: ov9282: Add missing clk_disable_unprepare to error path

 drivers/media/i2c/ov9282.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] media: i2c: ov9282: Fix missing documentation in structures
  2022-11-28 16:22 [PATCH 0/3] ov9282: Fix Smatch errors Dave Stevenson
@ 2022-11-28 16:22 ` Dave Stevenson
  2022-11-28 16:22 ` [PATCH 2/3] media: i2c: ov9282: Make common_regs_list static Dave Stevenson
  2022-11-28 16:22 ` [PATCH 3/3] media: i2c: ov9282: Add missing clk_disable_unprepare to error path Dave Stevenson
  2 siblings, 0 replies; 4+ messages in thread
From: Dave Stevenson @ 2022-11-28 16:22 UTC (permalink / raw)
  To: Paul J. Murphy, Daniele Alessandrelli, Sakari Ailus, linux-media
  Cc: Dave Stevenson

Fix missing documentation entries for members of structures,
as flagged by smatch.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
 drivers/media/i2c/ov9282.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
index 4ee93daa23c6..a8ab523b6a40 100644
--- a/drivers/media/i2c/ov9282.c
+++ b/drivers/media/i2c/ov9282.c
@@ -130,6 +130,7 @@ struct ov9282_reg_list {
  * @vblank_min: Minimum vertical blanking in lines
  * @vblank_max: Maximum vertical blanking in lines
  * @link_freq_idx: Link frequency index
+ * @crop: on-sensor cropping for this mode
  * @reg_list: Register list for sensor mode
  */
 struct ov9282_mode {
@@ -152,13 +153,16 @@ struct ov9282_mode {
  * @pad: Media pad. Only one pad supported
  * @reset_gpio: Sensor reset gpio
  * @inclk: Sensor input clock
+ * @supplies: Regulator supplies for the sensor
  * @ctrl_handler: V4L2 control handler
  * @link_freq_ctrl: Pointer to link frequency control
  * @hblank_ctrl: Pointer to horizontal blanking control
  * @vblank_ctrl: Pointer to vertical blanking control
  * @exp_ctrl: Pointer to exposure control
  * @again_ctrl: Pointer to analog gain control
+ * @pixel_rate: Pointer to pixel rate control
  * @vblank: Vertical blanking in lines
+ * @noncontinuous_clock: Selection of CSI2 noncontinuous clock mode
  * @cur_mode: Pointer to current selected sensor mode
  * @code: Mbus code currently selected
  * @mutex: Mutex for serializing sensor controls
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] media: i2c: ov9282: Make common_regs_list static
  2022-11-28 16:22 [PATCH 0/3] ov9282: Fix Smatch errors Dave Stevenson
  2022-11-28 16:22 ` [PATCH 1/3] media: i2c: ov9282: Fix missing documentation in structures Dave Stevenson
@ 2022-11-28 16:22 ` Dave Stevenson
  2022-11-28 16:22 ` [PATCH 3/3] media: i2c: ov9282: Add missing clk_disable_unprepare to error path Dave Stevenson
  2 siblings, 0 replies; 4+ messages in thread
From: Dave Stevenson @ 2022-11-28 16:22 UTC (permalink / raw)
  To: Paul J. Murphy, Daniele Alessandrelli, Sakari Ailus, linux-media
  Cc: Dave Stevenson

common_regs_list is only used within this file, so should
be static. Make it so.

Fixes: 7195aabf8f8b ("media: i2c: ov9282: Split registers into common and mode specific")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
 drivers/media/i2c/ov9282.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
index a8ab523b6a40..94e18da55a05 100644
--- a/drivers/media/i2c/ov9282.c
+++ b/drivers/media/i2c/ov9282.c
@@ -268,7 +268,7 @@ static const struct ov9282_reg common_regs[] = {
 	{0x5a08, 0x84},
 };
 
-struct ov9282_reg_list common_regs_list = {
+static struct ov9282_reg_list common_regs_list = {
 	.num_of_regs = ARRAY_SIZE(common_regs),
 	.regs = common_regs,
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] media: i2c: ov9282: Add missing clk_disable_unprepare to error path
  2022-11-28 16:22 [PATCH 0/3] ov9282: Fix Smatch errors Dave Stevenson
  2022-11-28 16:22 ` [PATCH 1/3] media: i2c: ov9282: Fix missing documentation in structures Dave Stevenson
  2022-11-28 16:22 ` [PATCH 2/3] media: i2c: ov9282: Make common_regs_list static Dave Stevenson
@ 2022-11-28 16:22 ` Dave Stevenson
  2 siblings, 0 replies; 4+ messages in thread
From: Dave Stevenson @ 2022-11-28 16:22 UTC (permalink / raw)
  To: Paul J. Murphy, Daniele Alessandrelli, Sakari Ailus, linux-media
  Cc: Dave Stevenson

If ov9282_power_on failed the I2C write, it returned without releasing
clocks or regulators. Fix this.

Fixes: 6f7def3d8a65 ("media: i2c: ov9282: Add selection for CSI2 clock mode")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
 drivers/media/i2c/ov9282.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
index 94e18da55a05..38b8d33799d5 100644
--- a/drivers/media/i2c/ov9282.c
+++ b/drivers/media/i2c/ov9282.c
@@ -1253,11 +1253,13 @@ static int ov9282_power_on(struct device *dev)
 					OV9282_GATED_CLOCK : 0);
 	if (ret) {
 		dev_err(ov9282->dev, "fail to write MIPI_CTRL00");
-		return ret;
+		goto error_clk;
 	}
 
 	return 0;
 
+error_clk:
+	clk_disable_unprepare(ov9282->inclk);
 error_reset:
 	gpiod_set_value_cansleep(ov9282->reset_gpio, 0);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-28 16:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-28 16:22 [PATCH 0/3] ov9282: Fix Smatch errors Dave Stevenson
2022-11-28 16:22 ` [PATCH 1/3] media: i2c: ov9282: Fix missing documentation in structures Dave Stevenson
2022-11-28 16:22 ` [PATCH 2/3] media: i2c: ov9282: Make common_regs_list static Dave Stevenson
2022-11-28 16:22 ` [PATCH 3/3] media: i2c: ov9282: Add missing clk_disable_unprepare to error path Dave Stevenson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox