Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3009375pxk; Mon, 28 Sep 2020 06:15:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWXwJrFlepe3mz8eO918KZ1i+9sYbeDadU7iikOdBPIWFGOTo2qu/kBkLdWq69eGq6N+KM X-Received: by 2002:a17:906:ce3b:: with SMTP id sd27mr1591020ejb.433.1601298927570; Mon, 28 Sep 2020 06:15:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601298927; cv=none; d=google.com; s=arc-20160816; b=W8hiCYs9J/aSAQs7c3Lw/hrBEI3WPzyifgIrFgqxtw7HMn9HWZocY9KS5ZzN8L0WkL nN0S3eBL8/GZd17dORr0IOAViS+FGk6uwoN5MjjPogCn8jKJJZNcOWY8UyTLPwTEUe/7 kAbArZCAAAUepwQI7+5Ob2v74pqn8FOqroBtMF7VqQLS0hKvaac5vo7gQ4a5CrCszuA5 hkfNpdHI2KL/d9V36wFY5MUg1TlC+X7dFs7blulkUMtYpALF7ajTXeInsh0njmIUh3Qk jZsxOF9C9EHR6PgNhR3RhzR43C6xvBopGclgvQsES3m2bS2s2JHN7WLFzkybrU0erKI2 pEGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=l3K/ikGaL4KEcuEFMJUwHGHEbciMv8TvEFjmQGXR94c=; b=u7StXNIIa2LgwdHaqUol1UvErjQPHdbyyypyjMNon7MKuIObj3QJJaaLP3dE/CHdhZ K8YzYeAEt+2jwsqrBLA5+uP+FHea3nFAczxHq6K1FSQV3YhNajRk+rfCC+SUcXPyBs77 jLdyM3YuXLqwKppd3/4qrxxDpsHw3sJPnxoZ+aMi6G1V9UvjHvClSeMrGagz4+F8UzUh 9llDJXSZ3nHm3cd+Qt3T3qDp1n6vBDe49BtKPckohU/gEvdo1dw2TPRlUDMfx+C48jUr 4B6nqaJ9igsxY/k5fzUy3A+w68hXb2zseAPIKRmpuPhkdK1Pdvq7JWFZ49+zPkmMVy2k 1nOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=QJpYnnyd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l25si579045eje.688.2020.09.28.06.15.04; Mon, 28 Sep 2020 06:15:27 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=QJpYnnyd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726566AbgI1NOG (ORCPT + 99 others); Mon, 28 Sep 2020 09:14:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbgI1NOG (ORCPT ); Mon, 28 Sep 2020 09:14:06 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E212C0613CF for ; Mon, 28 Sep 2020 06:14:05 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id g4so1283327edk.0 for ; Mon, 28 Sep 2020 06:14:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=l3K/ikGaL4KEcuEFMJUwHGHEbciMv8TvEFjmQGXR94c=; b=QJpYnnydDTm9ollDZBeV7iMr1rQVwH7tZLhOYVkSBLq5wKc8J6VWDDTsHLiCKyt/Z+ tXksvbbH4bkmiO9ruDyziaQIlwkdaFnZyOhBMGPIb4Xxmr0fxyM7Zj9C+7Ez7J5eq4/x tIyiexBI+9cXt6v/bV/LOBlvuqBb0cyPiwRyZBE5qB3BEscVSPDU8LRzIa0tIwwVQHmZ zS7IV7XId8mrauqrsENbPxaJVXfytMcDL1kOtCoET/GJ/J9VBGtf8/qsnzJQce+nTOIY M6ndRNpA3K4jCeGhW+kmoYG1P3AFh81TOWuu9OOJfrNUJVr4BuUpGFb9jwvYzhDHwrCW RwyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=l3K/ikGaL4KEcuEFMJUwHGHEbciMv8TvEFjmQGXR94c=; b=dximK4pjR24TcpjT2H2vnsqQVlXSkbdSujbpL/iaEGhMn922VP2ZQUrUmYyXrhQr+i PimW3hMmpkHT11xN5pSSyi8u7VRmTtpc/f6N8S7E22g7bJQiyVzWrXdrKijDlwCyOn1Z A1/ujctFQYbwSIKP+c3la0RRiGP1+bNh8qwb5YXrK1NFViBSNVPcsXnIEn60Yr5fjeep SjqE5sSP00ljc4ozyWYqE/3+mTTQiMKekXyIl6koz65YS8vh7NsL7K3tgMwOTXuH7EHO tRzD0wmyqbkJOKPPHzYEP5ayXZjG16xayQGUnNq/Wk2Ch2WfvKwymmPRrSmH3Z7xUOs+ sr/w== X-Gm-Message-State: AOAM531O4T7x1GCMz2YLB2ZDUGnjAHho/5rCbPELggFzbf7Bhp0DBreQ QttQSADRZckbLI6zyby0GGW00jPeksC9Z4ZbYTNoKQ== X-Received: by 2002:a05:6402:a51:: with SMTP id bt17mr1754936edb.186.1601298844257; Mon, 28 Sep 2020 06:14:04 -0700 (PDT) MIME-Version: 1.0 References: <20200928104155.7385-1-brgl@bgdev.pl> <20200928104155.7385-8-brgl@bgdev.pl> <20200928130023.GJ3956970@smile.fi.intel.com> In-Reply-To: <20200928130023.GJ3956970@smile.fi.intel.com> From: Bartosz Golaszewski Date: Mon, 28 Sep 2020 15:13:53 +0200 Message-ID: Subject: Re: [PATCH v2 7/9] gpio: mockup: pass the chip label as device property To: Andy Shevchenko Cc: Bartosz Golaszewski , Linus Walleij , Jonathan Corbet , Kent Gibson , linux-gpio , linux-doc , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2020 at 3:00 PM Andy Shevchenko wrote: > > 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". > > ^^^ here, see below > > 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? > I renamed the property, the previous "chip-name" is no longer used. In fact it was never used but was accounted for in GPIO_MOCKUP_MAX_PROP. Bart