Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5215534imm; Sun, 26 Aug 2018 13:44:38 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZLfMjv/RRSxg3Ce6I2q8zx6ATPQpWkl+bfGbB8lCjt6eWzt+k2laQvX11ZAV93xNoyiNY1 X-Received: by 2002:a17:902:1ab:: with SMTP id b40-v6mr10636789plb.55.1535316278163; Sun, 26 Aug 2018 13:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535316278; cv=none; d=google.com; s=arc-20160816; b=s1rnUWKRWTbvIShoezI3gEmdcTV9gDauvAlLV8qWh8nt2/Fj5o84ZRrxybh44tNitr 3kIGx7gTD6uzjs2VIdW5NH0Gj+C3eU7sF50LOlvfSv5GuwrjpMuIeW9CCUB/NUPYFsDE arSybYZm73bv2GLtqurQU/3pD3xH+Dcs34pLJvUJtsI9h9y8crgFeigQcHmNryKniDzm MfcaUxu3z8WnVrATqUmuvaVsw5ZK1Q2ki4xJie7kMEfFm4JvBj+nleG04pxMtzUhGAOX Z5qWWeQF90v+X99mdODdRxyRJlBEs7udyysXb+1g2DzCqfObCX+dldfr6ieoUpEQ9X+a NmCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=IJyzIYbG/szVhXIyOKoNHVc8ff8UZKrjln64R7TXASI=; b=XYviaVQ/AsSHI2OZeWWtuxjR4ZhQdiqUtRUmY/19/gnomjFFNDQt/FzxvAO4e6fPKX x6iDGWKFxInjIbPQGLOSP6O/1yZkN59ieJHN2HaCMBpbZpuUJehurmSdhVr+1ce/5ijs bJOvjBr31nW2RDl/5I2lytqChFTGOVrcFT2g2QrqpEklaEdzaYMxG8xSqT1C+NflxmCw W8u1mvKx0+MFm4fddU6p5vJW3wg9K028apVNcyWvBz/9pgphQXObmSdUVYhGstKF9CM8 DO2DF8vVsZiR0i+DKHkYPg+I6kL7lb2J+6D1TfbrDXN21IJVXgPmLLusKid2tkRP5uRk lqhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12-v6si15282038pfk.145.2018.08.26.13.43.57; Sun, 26 Aug 2018 13:44:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726831AbeH0AYz (ORCPT + 99 others); Sun, 26 Aug 2018 20:24:55 -0400 Received: from srv-hp10-72.netsons.net ([94.141.22.72]:41027 "EHLO srv-hp10-72.netsons.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbeH0AYz (ORCPT ); Sun, 26 Aug 2018 20:24:55 -0400 Received: from [146.241.227.52] (port=25220 helo=[192.168.77.64]) by srv-hp10.netsons.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1fu1qR-007p2h-2P; Sun, 26 Aug 2018 22:41:11 +0200 Subject: Re: [PATCH 3/7] media: imx274: don't hard-code the subdev name to DRIVER_NAME To: Sakari Ailus Cc: linux-media@vger.kernel.org, Leon Luo , Mauro Carvalho Chehab , Sakari Ailus , linux-kernel@vger.kernel.org, hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com References: <20180824163525.12694-1-luca@lucaceresoli.net> <20180824163525.12694-4-luca@lucaceresoli.net> <20180825144915.tq7m5jlikwndndzq@valkosipuli.retiisi.org.uk> From: Luca Ceresoli Message-ID: <799f4d1a-b91d-0404-7ef0-965d123319da@lucaceresoli.net> Date: Sun, 26 Aug 2018 22:41:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180825144915.tq7m5jlikwndndzq@valkosipuli.retiisi.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - srv-hp10.netsons.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: srv-hp10.netsons.net: authenticated_id: luca+lucaceresoli.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: srv-hp10.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sakari, On 25/08/2018 16:49, Sakari Ailus wrote: > Hi Luca, > > On Fri, Aug 24, 2018 at 06:35:21PM +0200, Luca Ceresoli wrote: >> Forcibly setting the subdev name to DRIVER_NAME (i.e. "IMX274") makes >> it non-unique and less informative. >> >> Let the driver use the default name from i2c, e.g. "IMX274 2-001a". >> >> Signed-off-by: Luca Ceresoli >> --- >> drivers/media/i2c/imx274.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c >> index 9b524de08470..570706695ca7 100644 >> --- a/drivers/media/i2c/imx274.c >> +++ b/drivers/media/i2c/imx274.c >> @@ -1885,7 +1885,6 @@ static int imx274_probe(struct i2c_client *client, >> imx274->client = client; >> sd = &imx274->sd; >> v4l2_i2c_subdev_init(sd, client, &imx274_subdev_ops); >> - strlcpy(sd->name, DRIVER_NAME, sizeof(sd->name)); >> sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; >> >> /* initialize subdev media pad */ > > This ends up changing the entity as well as the sub-device name which may > well break applications. Right, unfortunately. > On the other hand, you currently can't have more > than one of these devices on a media device complex due to the name being > specific to a driver, not the device. > > An option avoiding that would be to let the user choose by e.g. through a > Kconfig option would avoid having to address that, but I really hate adding > such options. I agree adding a Kconfig option just for this would be very annoying. However I think the issue affects a few other drivers (sr030pc30.c and s5c73m3-core.c apparently), thus maybe one option could serve them all. > I wonder what others think. If anyone ever needs to add another on a board > so that it ends up being the part of the same media device complex > (likely), then changing the name now rather than later would be the least > pain. In this case I'd be leaning (slightly) towards accepting the patch > and hoping there wouldn't be any fallout... I don't see any board (DT) > containing imx274, at least not in the upstream kernel. I'll be OK with either decision. Should we keep it as is, then I think a comment before that line would be appropriate to clarify it's not correct but it is kept for backward userspace compatibility. This would help avoid new driver writers doing the same mistake, and prevent other people to send another patch like mine. Regards, -- Luca