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: 998638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="emV670AN"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42wyvY0tSTz9s3Z for ; Fri, 16 Nov 2018 10:56:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726007AbeKPKGz (ORCPT ); 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-Google-Smtp-Source: AJdET5eDB6ouDgekF5Wts7StI4pgQefljSf8JqBhkNzRMQBlVikoJLBum7ceNpXLaM25SRpw+2AnOA== 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 Reviewed-by: Robert Jarzmik --- drivers/gpio/gpio-pca953x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;