From patchwork Tue Jan 2 10:32:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 123112 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8804718qgn; Tue, 2 Jan 2018 02:35:00 -0800 (PST) X-Google-Smtp-Source: ACJfBovI/vflc5LJZ+xg+tXLxP9d8ffyvABLJhSM4QfyG4GDD4OQw8FsEB9tJy+G49Ki3KCdch6F X-Received: by 10.159.231.19 with SMTP id w19mr45417626plq.45.1514889300151; Tue, 02 Jan 2018 02:35:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514889300; cv=none; d=google.com; s=arc-20160816; b=HF/jAtwT3qHuKeDZthlbL5NgmgTwnizs0iIQ6zKpvQzrwHsmXGke6aHgBAEQ7cHskp yz/DxYq4pDE/bvEQVVoTWCa35U/KOJdxsssmZrYB/x+KRIn9ikSrJ8eK0MICBPauvth6 sUs+roNcQ2lTwbcH3HJqxYbR2AMQmU7K75GNaURrQAe1EiUTpktmnlojEu4xMoXj93V9 WRrBVmqaQX6aLceM87I8c5S2cQm3a1VDNm/rr59Xi6oEiTswC/s+p0x98N2ZKZ/Cy8Rf E/wmZy9XzCaAI4fqzmTD3PPrlA6Qsq37Xd1eqsa+lYSOB3whMxwn8FpwsgPc4Ildk1Qw 5AuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=wJj27kJUvb5KmuY4VpGM5HwDJF5t5xKyNHI9W3S4I34=; b=QczwJgoWyCt55nLplutyKcZ/ssCuhjGyu61GLx5iMsLL5jA+PO9O7opbIoNEdZLf9a lgicAQggr5ZIHP05ppX5Pp5lJq+Sadd4rpqIPy2YfHkXZHEU7bP8CxIVotNINIfQUbrX jOSonRQOuboeIrQzpQK+YCKItu4MC74/XVa7xl0U+ot0r7zSph3unB89Yt0o1jIfQcHY oawVOdfSJURwoxqdxPm57ra3pGhPmvk50e7i84zJSWFwCWIp5sXc/7jcFZK1Ggx6Vy6M 0ETlzFWkjZWMlibNqvLF0MhYAFV0jOmkjXA91m85DuraQlWlG3QBjxt2KTtP4xN8MPF4 AsLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BYlwyIj4; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i7si23003737pgn.621.2018.01.02.02.34.59; Tue, 02 Jan 2018 02:35:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BYlwyIj4; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752455AbeABKe6 (ORCPT + 4 others); Tue, 2 Jan 2018 05:34:58 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:41265 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752198AbeABKe6 (ORCPT ); Tue, 2 Jan 2018 05:34:58 -0500 Received: by mail-lf0-f68.google.com with SMTP id h137so11069952lfe.8 for ; Tue, 02 Jan 2018 02:34:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=HLE7xKupW9DVHH+yY0HhVh7ovJARwfI/RDuzZm8gPcY=; b=BYlwyIj4UJWUZyAbI2vQvk4VFFC6gglp173aM0wvEcQf5m4h9VjFSyU0voMOUw6szO Ae7nCUWTuUEfbWIrTV0xanbSUp5KyElp8omJS+ojlwkrJodz6yNNggGYliW2kBz+uqyl m/LH4i9HNWb81ycRl9JAi7vhhMiKZOhtY97qw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HLE7xKupW9DVHH+yY0HhVh7ovJARwfI/RDuzZm8gPcY=; b=jC4HB2dEH4HxfIkYm2HYJ8MdcelppQei4jaDh7CkD34LPgMvsCTpJxLt3O25R9/3B4 vgG3AWEqewLQbbXg6D6ehhNctUlSBf7HoRoxdWZSOCydANZC5nfPD3p/F5B/TMFl6XNt bCqJVlECprG48V/P+bqkYTUBu25XE6Q1Wa5CZttgFsR/gxLYA6CiyIYfsUh2eh4f9lEl MlKyWeLtia43fj1M1r3o7EdQQ8UFhvSfPiUJJ/acSN3WWVktdn83h21ceTeyQ0On2JCW WA2nO43RQ8b2DB6OdqU78Ti7khHfQtxDCxgfzkhS7/Jyg7eJTMxxTgV5JW8TFjQCuAv/ o+dw== X-Gm-Message-State: AKGB3mK3lTiBNbhdiwgYCA3LUD9YlzdCH0OpuYZvIC+Hf6da8B7UzVya bK/vtmt2O3YDzSRxdkhQNBXIcw== X-Received: by 10.46.89.2 with SMTP id n2mr26850019ljb.149.1514889296689; Tue, 02 Jan 2018 02:34:56 -0800 (PST) Received: from localhost.localdomain (c-cb7471d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.116.203]) by smtp.gmail.com with ESMTPSA id l73sm5813658lfi.80.2018.01.02.02.34.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Jan 2018 02:34:55 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , linux-omap@vger.kernel.org Subject: [PATCH v2] gpio: omap: Give unique labels to each GPIO bank/chip Date: Tue, 2 Jan 2018 11:32:48 +0100 Message-Id: <20180102103248.15803-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org As we need to add GPIO lookup tables to the OMAP platforms, we need to reference each GPIO chip with a unique label. Use the GPIO base to name each chip, "gpio-0-31", "gpio-32-63" etc. Cc: Grygorii Strashko Cc: Santosh Shilimkar Cc: Kevin Hilman Cc: linux-omap@vger.kernel.org Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Break out errorpath fix to a separate patch. --- drivers/gpio/gpio-omap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index d83e8624964a..ed07bbcede01 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1059,6 +1059,7 @@ static void omap_gpio_mod_init(struct gpio_bank *bank) static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) { static int gpio; + const char *label; int irq_base = 0; int ret; @@ -1080,7 +1081,11 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) bank->chip.parent = &omap_mpuio_device.dev; bank->chip.base = OMAP_MPUIO(0); } else { - bank->chip.label = "gpio"; + label = devm_kasprintf(bank->chip.parent, GFP_KERNEL, "gpio-%d-%d", + gpio, gpio + bank->width - 1); + if (!label) + return -ENOMEM; + bank->chip.label = label; bank->chip.base = gpio; } bank->chip.ngpio = bank->width;