Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4041446imm; Sat, 25 Aug 2018 07:51:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbFvDstoUNAEEpXipYAcztZ2HqiXCShdWVyffcZx9wxHn8P5fPa7iCndih+ONCom5T4OEgg X-Received: by 2002:a62:6104:: with SMTP id v4-v6mr6644511pfb.122.1535208691684; Sat, 25 Aug 2018 07:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535208691; cv=none; d=google.com; s=arc-20160816; b=XhCxoT1gi5PIWKgRu4KjtFAza9FmhsSoHI1TvtORN9ir7BNzQCNnXRq0BHknDBfAFs 4wmXo6au+hCP23BHJ7opAq2SHn4Krj1n2xo3U6C9s+i45pTs+IrNsjiH3JLV59b1jc2X cf7PZtAR8wiA1qWjNboSO6HDJJi/n4Oo0HjwDc3vUrVUS9Kex580kyNIUL+TaNPtWWgs Swwf5jQ+mhZrPEcy8zp9TE4kIfza/SbT4aJvFBcS/BOblXDUSKa9IM2kCTFlMCWZnOkY G9VkOx4F+3IpyzGbqB/ZKCqIfNWHV76zlxLgELWeZS3uFUQEcYmYQ7fcXMRMfOYwX/ub 3nHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=XuigftGPrtN7ebJEvNz3ox+AnJKl9TEMhcPxXl3GqL8=; b=WkHFffycpOd1ZymwLhgNilP5kncHPZnUnGYLZuxMJgQ6ESoXZMiAWH0Rn7zoffyEiR e+ow8UNABAJdWfFLUnBWlJMh+L8gu7dJuty7hkDOZe6AvrelOLKVn8Plfwa6EBj5aq4m KXEHpv3iSJHFpOZIPNk5yV+5J3+XxREu2eScDT+9So1V7V7DXajgGEEmgCzmnll6LAhQ a6ekNGLOe0odj2weWe43AfI1mML7bg287cN5oT3E9pxhoz+gsvOAXgFbO283EBOUZpUY 6NSiJvPOPHx2YohHMAWLEs8eZTfTI/Eh8WQFpHHcDO8EURnBqYOvlG8mfJjhNLLRGoul j1EQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9-v6si9676477pli.494.2018.08.25.07.51.04; Sat, 25 Aug 2018 07:51:31 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726887AbeHYS2a (ORCPT + 99 others); Sat, 25 Aug 2018 14:28:30 -0400 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:49082 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726672AbeHYS2a (ORCPT ); Sat, 25 Aug 2018 14:28:30 -0400 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2001:1bc8:1a6:d3d5::80:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id 5120C634C83; Sat, 25 Aug 2018 17:49:16 +0300 (EEST) Received: from sakke by valkosipuli.localdomain with local (Exim 4.89) (envelope-from ) id 1ftZsK-0000Sv-0q; Sat, 25 Aug 2018 17:49:16 +0300 Date: Sat, 25 Aug 2018 17:49:15 +0300 From: Sakari Ailus To: Luca Ceresoli 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 Subject: Re: [PATCH 3/7] media: imx274: don't hard-code the subdev name to DRIVER_NAME Message-ID: <20180825144915.tq7m5jlikwndndzq@valkosipuli.retiisi.org.uk> References: <20180824163525.12694-1-luca@lucaceresoli.net> <20180824163525.12694-4-luca@lucaceresoli.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180824163525.12694-4-luca@lucaceresoli.net> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 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. Cc Hans and Laurent. -- Kind regards, Sakari Ailus e-mail: sakari.ailus@iki.fi