Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2997941pxk; Mon, 28 Sep 2020 06:02:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSeyKh+LCnzoLoOAb0ZZTFE54pXKubE2Fg4R+yhRbQnD0MZKWvolYlKZdFmfX3QI3E1VbJ X-Received: by 2002:a50:99d6:: with SMTP id n22mr1619176edb.265.1601298125474; Mon, 28 Sep 2020 06:02:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601298125; cv=none; d=google.com; s=arc-20160816; b=ncm/tZe7vJX1HE7s7Rhhp1Gv8a03Z0xy5V9XY6XX6i2YBP6OEjfX7AjCpb7t3t1K4R InmKOz0hFGMSjNC9USpqoMvEYrVeXR9F9wDjes/cSxuVYOUCjA/CEiafteaB18B4v/f5 s0ZO9MJJdJ0D+TwRmY8pbogmO+QpmjqfuphYuuqWBDhBWPAaYOw+nPEuz1Hs5++i9ek0 XoAoAbzN53GqZV7CtYd/LuZvlbedEhOnFwyQ2JF+8i1jrZnbYOgla+Hii7fcd6ZYaGMA kuOxFfhSma5MtzfWj7DXuW2N7STKUFh1gJYyl49pxUhTtP0JOIGkANGXV2K6xbg9IXtc wd1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=BCUjeSX31stfMwGQ3qLaStUQoMw8On2BtPYJ2ZKRTc8=; b=fHooy1AJlsmxVKJNgG3vFUudbc0mYW2OY0YM8dbjvhuavf2TC/2ZGPTdoHS3tYZXp7 rZtz3l2eby4jTz5Y2zP/CP7ZCZxMdWpTH/xU+IbXOkyqmNSgJvRCdk7vOMhBquiaIYA5 J/DCLuh+w+lpH1z59ruaSx6Zsn8mqsgtL0XQ/Aos587g2Oa4RiF7qO1BvZi7PiYB9dl3 Bwe5IrvMVtDY6P8QAftFHToNnuEotSHOtPD9xAsAFJxHnzI+HXkkeutVoYMFggafUDaZ 1yFgCeIjUKZ9byD95VIRG00qB7QNZHj/Q9ajBD97d8xZzAjKmyCagOC4MrxSMF3XTv2Q MJEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di24si492048edb.608.2020.09.28.06.01.40; Mon, 28 Sep 2020 06:02:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726506AbgI1NAd (ORCPT + 99 others); Mon, 28 Sep 2020 09:00:33 -0400 Received: from mga09.intel.com ([134.134.136.24]:2358 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725290AbgI1NAd (ORCPT ); Mon, 28 Sep 2020 09:00:33 -0400 IronPort-SDR: DSgf+qwEPBOKjnP4pNvuUgZPpSgaklzSgyxENdAlfOT8j85YYSgWVz1k+DExt0BqYpDyIywCzx LYwh9khPYWog== X-IronPort-AV: E=McAfee;i="6000,8403,9757"; a="162870664" X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="162870664" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 06:00:31 -0700 IronPort-SDR: bKZ6s57xkqmVewKhpx53S+93hRUANHEiIHt9FYzTw98LSRexWTy3Wv4yivfJ4ZMIJcORZSVisP GtRIuPiLm8fQ== X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="350713488" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 06:00:29 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kMslT-002Z72-Vt; Mon, 28 Sep 2020 16:00:23 +0300 Date: Mon, 28 Sep 2020 16:00:23 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , Jonathan Corbet , Kent Gibson , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v2 7/9] gpio: mockup: pass the chip label as device property Message-ID: <20200928130023.GJ3956970@smile.fi.intel.com> References: <20200928104155.7385-1-brgl@bgdev.pl> <20200928104155.7385-8-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200928104155.7385-8-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2020 at 12:41:53PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > While we do check the "chip-name" property in probe(), we never actually > use it. Let's pass the chip label to the driver using device properties > as we'll want to allow users to define their own once dynamically > created chips are supported. > > The property is renamed to "chip-label" to not cause any confusion with > the actual chip name which is of the form: "gpiochipX". > > If the "chip-label" property is missing, let's do what most devices in > drivers/gpio/ do and use dev_name(). ... > + snprintf(chip_label, sizeof(chip_label), > + "gpio-mockup-%c", i + 'A'); > + properties[prop++] = PROPERTY_ENTRY_STRING("chip-label", > + chip_label); You added new property, now count is up to 4. But at the same time #define GPIO_MOCKUP_MAX_PROP 4 how do you avoid overflow? -- With Best Regards, Andy Shevchenko