Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6315162ybc; Wed, 27 Nov 2019 19:48:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwdJ0EI/vKwPXVH4QD5XFv++l+frlX9deizt5uflbJIHjrYTtwjL5k/3Psn6Dc6+IaNqhkX X-Received: by 2002:a50:ce56:: with SMTP id k22mr2084168edj.34.1574912902312; Wed, 27 Nov 2019 19:48:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574912902; cv=none; d=google.com; s=arc-20160816; b=mzkoinD1faJ0PjEqTCOx7DM06DHRD2L6dRiKYjxDaw9cukeLMH5kPCyscA/DS2BXrq WkYg30QKANaaMfywd3IYZjxhUC7cY0ICgs/xja6pHjkoktgdq0rguMlYwTu6Uxg+DDeM f53HAvWu2R+Cy9Rlh7q6udW4QJRkCFUT+csySewr9PWfv+lcHewxwGBpozTSi4c/wfFS msR38J5v0Bbmy+DtSiraBnjweEzwRuc2/sSiCa/dx2nlQcVbZehNHqJO0etssT0vbS0k SOLIa5MLJAw6eo6Sco1gpa7oEfKCZDWKEgb01gHayKwS/d09J17UgUqIj/zOIp91f0E1 8ShQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:dkim-signature; bh=nvzO8rqYdXuIPjP0LXy5wKBL7E3Y7S8VI2AMrtpVuGw=; b=jjlfjnjs9FXOjn+L0JAkJN4M3ycuNHBnkZyjCqXsnHeo8qvK83/HMHbII48OqU+Ur/ BZ8qv2tODO5VR/xRBqZjPENjFI0WRm3X/wkVOLYp0sS7Fllx+GiK96ita11xGMd09LQr ujWPqTBHj8vDGCZf8+7CjxYzd3Uosz/To7BfTGWMs22KmhMkcDtWeAx5SettnwfdovkA M+x9MI5vgpQ6QoFUv2Qrr4vwJHIagTqmVP/LoJCxSGFfJOZH4pS8SDLu8GCKNGWWPkLP NfETnjcE+DAkGlXMh1/MHEDi3Cfm7jFItNpkSjvPtQBdEzLlJlRhvfaOlSy/Rzu3AONS myRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@fpond.eu header.s=strato-dkim-0002 header.b=PFclMg4E; 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 s24si11781177edx.223.2019.11.27.19.47.58; Wed, 27 Nov 2019 19:48:22 -0800 (PST) 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; dkim=fail header.i=@fpond.eu header.s=strato-dkim-0002 header.b=PFclMg4E; 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 S1727436AbfK1Dop (ORCPT + 99 others); Wed, 27 Nov 2019 22:44:45 -0500 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.170]:19338 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727117AbfK1Doo (ORCPT ); Wed, 27 Nov 2019 22:44:44 -0500 X-Greylist: delayed 348 seconds by postgrey-1.27 at vger.kernel.org; Wed, 27 Nov 2019 22:44:42 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1574912681; s=strato-dkim-0002; d=fpond.eu; h=Subject:References:In-Reply-To:Message-ID:Cc:To:From:Date: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=nvzO8rqYdXuIPjP0LXy5wKBL7E3Y7S8VI2AMrtpVuGw=; b=PFclMg4EFSJ57I2l8e9SLhyyJ0lo4j9gQOL/+hg75rXhXe/iv9zfFaow6PMx7KMGi0 kM3Q/HKGaPTWry/0tp5DCvg/n61UxaccEI1Tjl9JhFrs/m94SuOahR5jeHvf233mqWvY v7IR49TyI8D4sV4clCQdaPJQ347IvCTwnRG4w0fG97f6pqKqkQ4tXVagfoP1P9JUAEty zhZlcyikYOtp8hXxNCp6dC6avl+l2U4U82cENXaOAQDwfz2fYHxoSjCSBb6Xpe5nmq63 SforMexiig6Ha4z2bYQFWpCeeiDQWetTw8SYlzstENyxzWcyQY7HAxGuQc1ktBCSKu+r uWDQ== X-RZG-AUTH: ":OWANVUa4dPFUgKR/3dpvnYP0Np73amq+g13rqGzmt2bYDnKIKaws6YXTsc4=" X-RZG-CLASS-ID: mo00 Received: from oxapp04-01.back.ox.d0m.de by smtp-ox.front (RZmta 46.0.0 AUTH) with ESMTPSA id 604beevAS3cd2Io (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Thu, 28 Nov 2019 04:38:39 +0100 (CET) Date: Thu, 28 Nov 2019 04:38:39 +0100 (CET) From: Ulrich Hecht To: Geert Uytterhoeven , Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Rob Herring , Mark Rutland , Harish Jenny K N , Eugeniu Rosca Cc: Alexander Graf , Peter Maydell , Paolo Bonzini , Phil Reid , Marc Zyngier , Christoffer Dall , Magnus Damm , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, qemu-devel@nongnu.org Message-ID: <1936168849.1467696.1574912319589@webmail.strato.com> In-Reply-To: <20191127084253.16356-2-geert+renesas@glider.be> References: <20191127084253.16356-1-geert+renesas@glider.be> <20191127084253.16356-2-geert+renesas@glider.be> Subject: Re: [PATCH v3 1/7] gpiolib: Add GPIOCHIP_NAME definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.1-Rev22 X-Originating-IP: 112.198.74.215 X-Originating-Client: open-xchange-appsuite Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On November 27, 2019 at 9:42 AM Geert Uytterhoeven wrote: > > > The string literal "gpiochip" is used in several places. > Add a definition for it, and use it everywhere, to make sure everything > stays in sync. > > Signed-off-by: Geert Uytterhoeven > --- > v3: > - New. > --- > drivers/gpio/gpiolib-sysfs.c | 7 +++---- > drivers/gpio/gpiolib.c | 4 ++-- > drivers/gpio/gpiolib.h | 2 ++ > 3 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c > index fbf6b1a0a4fae6ce..23e3d335cd543d53 100644 > --- a/drivers/gpio/gpiolib-sysfs.c > +++ b/drivers/gpio/gpiolib-sysfs.c > @@ -762,10 +762,9 @@ int gpiochip_sysfs_register(struct gpio_device *gdev) > parent = &gdev->dev; > > /* use chip->base for the ID; it's already known to be unique */ > - dev = device_create_with_groups(&gpio_class, parent, > - MKDEV(0, 0), > - chip, gpiochip_groups, > - "gpiochip%d", chip->base); > + dev = device_create_with_groups(&gpio_class, parent, MKDEV(0, 0), chip, > + gpiochip_groups, GPIOCHIP_NAME "%d", > + chip->base); > if (IS_ERR(dev)) > return PTR_ERR(dev); > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index dce0b31f4125a6b3..c9e47620d2434983 100644 > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -1419,7 +1419,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, > ret = gdev->id; > goto err_free_gdev; > } > - dev_set_name(&gdev->dev, "gpiochip%d", gdev->id); > + dev_set_name(&gdev->dev, GPIOCHIP_NAME "%d", gdev->id); > device_initialize(&gdev->dev); > dev_set_drvdata(&gdev->dev, gdev); > if (chip->parent && chip->parent->driver) > @@ -5105,7 +5105,7 @@ static int __init gpiolib_dev_init(void) > return ret; > } > > - ret = alloc_chrdev_region(&gpio_devt, 0, GPIO_DEV_MAX, "gpiochip"); > + ret = alloc_chrdev_region(&gpio_devt, 0, GPIO_DEV_MAX, GPIOCHIP_NAME); > if (ret < 0) { > pr_err("gpiolib: failed to allocate char dev region\n"); > bus_unregister(&gpio_bus_type); > diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h > index ca9bc1e4803c2979..a4a759920faa48ab 100644 > --- a/drivers/gpio/gpiolib.h > +++ b/drivers/gpio/gpiolib.h > @@ -16,6 +16,8 @@ > #include > #include > > +#define GPIOCHIP_NAME "gpiochip" > + > /** > * struct gpio_device - internal state container for GPIO devices > * @id: numerical ID number for the GPIO chip > -- > 2.17.1 > Reviewed-by: Ulrich Hecht CU Uli