Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5249564ybc; Wed, 27 Nov 2019 00:47:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzst5OupHepdTxBf36lw+8kdItDh4ARqWUXcZquGMRF4uvcLAPG8nGBFPBu/1BZRnXLplKH X-Received: by 2002:a17:906:82d0:: with SMTP id a16mr20114791ejy.206.1574844465016; Wed, 27 Nov 2019 00:47:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574844465; cv=none; d=google.com; s=arc-20160816; b=jl+V6bMSrVM6l9i/EZt1ZaYEyPPhk9Oa/69GhwlRUEJ/kLjDSDcZEHUmE6IXrr7lKQ 6Q43Zj5qv8EoYNmL0kdTi35FhGu8H1qwN/X4QX3k9wiDf1dl4QItRKVj9aEsmCBB74hD tdj0L9EYioVPMNfLgolsZvaoD+mbRyPVZynLxmf+W0HfH1KrmKXs+6OXKDYTb8BdIsZy deWWgddRdCMhsb75AcV+yhLvCZc4XnAj20TnQoOgwcPxPj2afNWV9kS/Oqpg330oL58s 5VYbrdONjf1vdSGEVI4xoD+E5yWDIunNx942BjURDfNq7CotNJ544vKwmlnhi2iUgZgJ 1PDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=3zJLhsIDNIBB8R92SGrNQkumLjHBCGDJbzFfTQdczeA=; b=XQOQjwfwaOYZixjPngo1cQfg/cnTfpNriDHeM9/c3hD+CJo/pkfUcVc6s5nr7XnL5j /pCgepMT3RQtKn56Y6E1Tby/n7KsMmG0DCY5Bn7wUAbV0eJTCnC+Qs+5AwBiEQb5A7fZ p8WLHV4xL+qNNdI0OuSdscEaU+sRul2K9ALPFPORYIWeoocyJ5NA2GqOM8ampwS4tNHc rrzfuGO63AUu/dLEMGt7c37bNDQgdF3v6O3By6KO9YVzBf4r1/GLQvlKDaeBqE+DAeSI xmemOSYorn1EKBpztBTY5qGwK9gpJSpYR/lCBBUOuyigVuap/NqVvdS2ZWnhuXDM5zYk KfWA== 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 z16si10265556edd.314.2019.11.27.00.47.21; Wed, 27 Nov 2019 00:47:44 -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; 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 S1727125AbfK0Ing (ORCPT + 99 others); Wed, 27 Nov 2019 03:43:36 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:47534 "EHLO michel.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726858AbfK0InK (ORCPT ); Wed, 27 Nov 2019 03:43:10 -0500 Received: from ramsan ([84.195.182.253]) by michel.telenet-ops.be with bizsmtp id Wwiu2100e5USYZQ06wiuWY; Wed, 27 Nov 2019 09:43:08 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iZsuU-0000xe-KQ; Wed, 27 Nov 2019 09:42:54 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iZsuU-0004OJ-IG; Wed, 27 Nov 2019 09:42:54 +0100 From: Geert Uytterhoeven To: 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, Geert Uytterhoeven Subject: [PATCH v3 1/7] gpiolib: Add GPIOCHIP_NAME definition Date: Wed, 27 Nov 2019 09:42:47 +0100 Message-Id: <20191127084253.16356-2-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191127084253.16356-1-geert+renesas@glider.be> References: <20191127084253.16356-1-geert+renesas@glider.be> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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