All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: "Rui Miguel Silva" <rmfrfs@gmail.com>,
	"Steve Longerbeam" <slongerbeam@gmail.com>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Jérôme Brunet" <jbrunet@baylibre.com>,
	"Sakari Ailus" <sakari.ailus@iki.fi>
Subject: [PATCH v1 3/3] staging: media: imx: imx7-mipi-csis: Make subdev name unique
Date: Thu,  6 Jan 2022 19:24:41 +0200	[thread overview]
Message-ID: <20220106172441.7399-4-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20220106172441.7399-1-laurent.pinchart@ideasonboard.com>

When multiple CSIS instances are present in a single graph, they are
currently all named "imx7-mipi-csis.0", which breaks the entity name
uniqueness requirement. Fix it by using the device name to create the
subdev name.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/staging/media/imx/imx7-mipi-csis.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
index d7bcfb1a0c52..6443cca817fe 100644
--- a/drivers/staging/media/imx/imx7-mipi-csis.c
+++ b/drivers/staging/media/imx/imx7-mipi-csis.c
@@ -32,7 +32,6 @@
 #include <media/v4l2-subdev.h>
 
 #define CSIS_DRIVER_NAME			"imx7-mipi-csis"
-#define CSIS_SUBDEV_NAME			CSIS_DRIVER_NAME
 
 #define CSIS_PAD_SINK				0
 #define CSIS_PAD_SOURCE				1
@@ -313,7 +312,6 @@ struct csi_state {
 	struct reset_control *mrst;
 	struct regulator *mipi_phy_regulator;
 	const struct mipi_csis_info *info;
-	u8 index;
 
 	struct v4l2_subdev sd;
 	struct media_pad pads[CSIS_PADS_NUM];
@@ -1329,8 +1327,8 @@ static int mipi_csis_subdev_init(struct csi_state *state)
 
 	v4l2_subdev_init(sd, &mipi_csis_subdev_ops);
 	sd->owner = THIS_MODULE;
-	snprintf(sd->name, sizeof(sd->name), "%s.%d",
-		 CSIS_SUBDEV_NAME, state->index);
+	snprintf(sd->name, sizeof(sd->name), "csis-%s",
+		 dev_name(state->dev));
 
 	sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 	sd->ctrl_handler = NULL;
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2022-01-06 17:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 17:24 [PATCH v1 0/3] staging: media: imx7-mipi-csis: Small improvements Laurent Pinchart
2022-01-06 17:24 ` [PATCH v1 1/3] staging: media: imx: imx7-mipi-csis: Dump MIPI_CSIS_FRAME_COUNTER_CH0 register Laurent Pinchart
2022-01-07 10:27   ` Rui Miguel Silva
2022-01-06 17:24 ` [PATCH v1 2/3] staging: media: imx: imx7_mipi_csis: Add timings override through debugfs Laurent Pinchart
2022-01-07 10:27   ` Rui Miguel Silva
2022-01-07 11:21     ` Laurent Pinchart
2022-01-06 17:24 ` Laurent Pinchart [this message]
2022-01-07 10:27   ` [PATCH v1 3/3] staging: media: imx: imx7-mipi-csis: Make subdev name unique Rui Miguel Silva
2022-01-07 11:52   ` Sakari Ailus

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=20220106172441.7399-4-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=jbrunet@baylibre.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=rmfrfs@gmail.com \
    --cc=sakari.ailus@iki.fi \
    --cc=slongerbeam@gmail.com \
    /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.