From patchwork Fri Sep 28 22:49:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 147812 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp1298745lji; Fri, 28 Sep 2018 15:49:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV61e1hgFNe9a4cAEHmvaxqa0YnXk5pa7aEAhf1yt6tU+3JZ74moMCHQdZuaATTwKE4CRbpnk X-Received: by 2002:a62:174a:: with SMTP id 71-v6mr623141pfx.217.1538174991788; Fri, 28 Sep 2018 15:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538174991; cv=none; d=google.com; s=arc-20160816; b=X794A2fcsVsJG1uUZg+u9OpYBLBrK+tdu8OfKlswlgsFSYtAKglsH+HRrpfqrDsUoS MlbzUbiA36OY0gLaR+YY2sfwekF8b/Z2lD9du1hW9Un0rAiTlXIodYIKTkCXW5Z33es4 WQPA4CJIsJKoU1JiGt4FAI1kJsM3ikzH92MlF7tskCIwuvHiLdVPXzneDfg7qxdGlJ1b hWwwWOhurWb54wKQMyQ/ZNy4mMPwJeUSi3AvOYRpu0iwTqW3EvQYQ/zDu4zqBiZB30S9 w4cDpMbj8TWqCSiEsU2nV8OtiWSR9iDSJdwF8bZHXhmIKKH4COK5YWxK6HVEcmLCjLS+ sZCQ== 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; bh=qJjaNrXr1jwNWUcqFYNoeheLOX/BIq6piV6Dc8qewnY=; b=fUkSiqFqoK/ZPTS3znqC/bDhGIjg9+djPT8SNC/O+O7tdEXlxmgwNpE2vTMDRHLMaA 6ZQjc1InPTzoQUWmPfLy3/O7ZFhBxAeibgOnzDV2DeOLo0782tIHGvlU/j6Ugs9H9pUG M0wIAkE2u2BtQlhG4/5TxfOQpvfQ8Qi4PWkMezr5sAVNNBRb8IzCupLKtZfgRn2uqxyZ bDEgbX/aW66QCxmd/wmfkH93s2kJIg+SmCV69XuI9ui0SaG0fyjnq7M7ZL326GUDBiBW ZRMyFoeotczZmhw8MFYqS5eJPu3tV8BQNgQv5makz95nXzCevmrc222/fJiqKTgvEtsJ ns7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 96-v6si6370829pld.398.2018.09.28.15.49.51; Fri, 28 Sep 2018 15:49:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-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-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726483AbeI2FPq (ORCPT + 2 others); Sat, 29 Sep 2018 01:15:46 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:39690 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbeI2FPq (ORCPT ); Sat, 29 Sep 2018 01:15:46 -0400 Received: by mail-oi1-f194.google.com with SMTP id y81-v6so6764484oia.6; Fri, 28 Sep 2018 15:49:50 -0700 (PDT) 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=qJjaNrXr1jwNWUcqFYNoeheLOX/BIq6piV6Dc8qewnY=; b=oQzQ/zWwZNxi6Sl/veMDew/GBKPMXTGztQQCLDTYV/1h7xBukf9vTl5iVK9KbcvU8+ SZANH4+M8ogvlpRAQjiQa2c/s1wfZR1C/u5QyfPz70eajhi+ozhy2BnzBkhR9FGZvTXX /aDdQg1hS1pmldz8oTzMQ4qgUOkVzCpGnotYb6fMOkwLDFmnz28xg4/Gj1KjZk52cUK3 fk7FfjYW52R8O/MdwlHljHZCN1YXnxModTYnpFPyYz0vO0izcRKKeLESqV2X5qiv6r+Z PJl9RWSpUrjF//K1d/qqian7nSInmtPs6KoKbo1heFGXf8SymRGWycYpkG5UoSJ/8Yp0 wUXA== X-Gm-Message-State: ABuFfojIdYcDAQFF4lVIgX8Y9BaxL8kauPTFnKHarOXFlsmlfEojOjIr wZ2S0EWp2uyR+hiBrkVfN+f2LGrgvw== X-Received: by 2002:aca:3546:: with SMTP id c67-v6mr382026oia.249.1538174989463; Fri, 28 Sep 2018 15:49:49 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id n26-v6sm1972676oic.5.2018.09.28.15.49.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 15:49:48 -0700 (PDT) From: Rob Herring To: linux-kernel@vger.kernel.org Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Peter Rosin , linux-i2c@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2] i2c: Convert to using %pOFn instead of device_node.name Date: Fri, 28 Sep 2018 17:49:47 -0500 Message-Id: <20180928224947.19058-1-robh@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Peter Rosin Cc: linux-i2c@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring --- v2: - Remove initialization of parent drivers/i2c/busses/i2c-powermac.c | 17 +++++++++-------- drivers/i2c/muxes/i2c-mux-gpmux.c | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c index f2a2067525ef..f6f4ed8afc93 100644 --- a/drivers/i2c/busses/i2c-powermac.c +++ b/drivers/i2c/busses/i2c-powermac.c @@ -388,9 +388,8 @@ static void i2c_powermac_register_devices(struct i2c_adapter *adap, static int i2c_powermac_probe(struct platform_device *dev) { struct pmac_i2c_bus *bus = dev_get_platdata(&dev->dev); - struct device_node *parent = NULL; + struct device_node *parent; struct i2c_adapter *adapter; - const char *basename; int rc; if (bus == NULL) @@ -407,23 +406,25 @@ static int i2c_powermac_probe(struct platform_device *dev) parent = of_get_parent(pmac_i2c_get_controller(bus)); if (parent == NULL) return -EINVAL; - basename = parent->name; + snprintf(adapter->name, sizeof(adapter->name), "%pOFn %d", + parent, + pmac_i2c_get_channel(bus)); + of_node_put(parent); break; case pmac_i2c_bus_pmu: - basename = "pmu"; + snprintf(adapter->name, sizeof(adapter->name), "pmu %d", + pmac_i2c_get_channel(bus)); break; case pmac_i2c_bus_smu: /* This is not what we used to do but I'm fixing drivers at * the same time as this change */ - basename = "smu"; + snprintf(adapter->name, sizeof(adapter->name), "smu %d", + pmac_i2c_get_channel(bus)); break; default: return -EINVAL; } - snprintf(adapter->name, sizeof(adapter->name), "%s %d", basename, - pmac_i2c_get_channel(bus)); - of_node_put(parent); platform_set_drvdata(dev, adapter); adapter->algo = &i2c_powermac_algorithm; diff --git a/drivers/i2c/muxes/i2c-mux-gpmux.c b/drivers/i2c/muxes/i2c-mux-gpmux.c index 92cf5f48afe6..f60b670deff7 100644 --- a/drivers/i2c/muxes/i2c-mux-gpmux.c +++ b/drivers/i2c/muxes/i2c-mux-gpmux.c @@ -120,8 +120,8 @@ static int i2c_mux_probe(struct platform_device *pdev) ret = of_property_read_u32(child, "reg", &chan); if (ret < 0) { - dev_err(dev, "no reg property for node '%s'\n", - child->name); + dev_err(dev, "no reg property for node '%pOFn'\n", + child); goto err_children; }