From patchwork Thu Nov 15 23:54:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 151261 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7647496ljp; Thu, 15 Nov 2018 15:56:56 -0800 (PST) X-Google-Smtp-Source: AJdET5fmFtgzdIMMcFkGozZJspkKsUPS18l4U8N+1KkSwy97EDJ3DyxJfVptVKXcuQfhF5vz8Fsl X-Received: by 2002:a63:e101:: with SMTP id z1mr7778630pgh.310.1542326216245; Thu, 15 Nov 2018 15:56:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542326216; cv=none; d=google.com; s=arc-20160816; b=WHFVvXqtF/I+sPpSOifZ8SlCdoWz/wh+zbEQXp/snaRnYt5wgNg2CwdjcK1BnO+0mZ 9SglaL7c2xLZzD9cXPxqTEaVXjZnkhPOjE8LabPjgCnGbWNo9iTg9Gg+olhmXAJDgNZ8 wnhFjOtRQoONaS3VqEWNLsCaw8Uw+vHlfNPugTWp66BvH9ebdJb797wZfKQ8FzzLE/ry QiP6y4W5n/0cW/errVYfLATwfs8a1IwaHlDX+ULBE87+X/PBdJgUU31muj291IfJWqYg KwXEOg4sQy5+G6hFc2GdRVs2YNOpgiGV4lo5UVM1vsgoF21hNdePshkCkYf4L6p1/kC/ y3yw== 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; bh=E6ZmIWOx1GZ7hJ8hV2QDxvY/5YGqII8ujHWG69wGzdk=; b=OjUZWioAPVlJw5CkKN3eMmEyDCFoWLsjism0gO+01xtpUszZH6NQ67Th283NCZdFLz MY0W0nDPcFh95iKTBigLRBiiPvBGJbtWugULzANMZH4p4xFjjoFK0JdfwJ1TnrJuA+Bs ev1oSW+i2zSfMYw5wlepEN829WiSxlNu1CVL1VtEK3arvzabBwBTIuBa0VzjrWNEAYJz hq3J4beesG0PYn/CITCpxNVO/xqXqvdxe6dt+BXrIyHcTAALSusfWxZcEK65qLrG8qMe TfGNIazU+6Arr2ipf1nVv0TjWCxjArF9eQgtwfLn/+xus2B9aekJSieqFA5YjArL5d06 DQ/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=emV670AN; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (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 h36si27879654pgm.200.2018.11.15.15.56.55; Thu, 15 Nov 2018 15:56:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=emV670AN; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726007AbeKPKGz (ORCPT + 5 others); Fri, 16 Nov 2018 05:06:55 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:45062 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbeKPKGz (ORCPT ); Fri, 16 Nov 2018 05:06:55 -0500 Received: by mail-lf1-f65.google.com with SMTP id b20so15353219lfa.12 for ; Thu, 15 Nov 2018 15:56:53 -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=E6ZmIWOx1GZ7hJ8hV2QDxvY/5YGqII8ujHWG69wGzdk=; b=emV670ANH1yhDbEWJM1++tNQOk6TjOs7C/G6O5fvcTjZ7Cd/8wWwPp63xH9btESNKi /0RSkRDccYa1WHsk7tTlX7JFoer4ruQDfqKosapN60MZojhs3CM2hnJkfdaujGiviH47 nDqPu7E2o08a/zi9NoBAJ3z7drCWj/prGmMBQ= 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=E6ZmIWOx1GZ7hJ8hV2QDxvY/5YGqII8ujHWG69wGzdk=; b=HHYnVUBM9UGF0FbgjCdroLKdGazRKnxAMD22BaBvhR3pcYT+NeRTjCzbKrerDoxeEh 0shVEER9z287F94NkeVP5mGNfM1y3Gc69aTT/r662uFCfnYbaHLd+KtJa5joJ2P8cbVv YgCG9RUUHkcPHDk98leuI1nlF1ZOr11SvIjlmfyLexfc9XqxKgzmLpys7JlxVeke+JQh BlaE1Zp5Jw7rOr4VUzfI6/KiEWO+E9hMZ3HGN86dM6AJJXy+9Z7fASX8JW89JInB6b9l HZ/+4qNhNOfUgGnirseZFNjXOrEsgsHtivMDV6O6laZag1HwzGFXcW3/4OpXtiL3RpaB IrEg== X-Gm-Message-State: AGRZ1gKJ+XidP5lnaqXvfMbmSact+FSwv09MONyGOugHtgAX/geQuWwU wW1lP0dNqKrFuN7WlRm9oC62VsvwDwGXaw== X-Received: by 2002:a19:5510:: with SMTP id n16mr4396784lfe.68.1542326212028; Thu, 15 Nov 2018 15:56:52 -0800 (PST) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id c14sm4500567lfb.40.2018.11.15.15.56.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Nov 2018 15:56:50 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Robert Jarzmik Subject: [PATCH] gpio: name PCA953x gpio chips after device name Date: Fri, 16 Nov 2018 00:54:42 +0100 Message-Id: <20181115235442.27494-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.2 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Instead of using the name directly from the I2C client to name the gpio_chip, use dev_name() on the client->dev, so we get the sometimes more unique device name, as I2C has a mechanism for naming its devices explicitly in e.g. board data. This is a prerequisite for being able to reference uniquely any I2C GPIO expander defined in a board file when setting up GPIO descriptor tables. Cc: Robert Jarzmik Signed-off-by: Linus Walleij --- drivers/gpio/gpio-pca953x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.2 Reviewed-by: Robert Jarzmik diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 023a32cfac42..540166443c34 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -449,7 +449,7 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios) gc->base = chip->gpio_start; gc->ngpio = gpios; - gc->label = chip->client->name; + gc->label = dev_name(&chip->client->dev); gc->parent = &chip->client->dev; gc->owner = THIS_MODULE; gc->names = chip->names;