Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6552719imm; Mon, 27 Aug 2018 18:54:38 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYfgeiVIExK2PUPtWJARSaJl2zycrJxnoMb2o6lwV6BjOndZdexb03V59FUIJzpAt9wT7fp X-Received: by 2002:a63:1316:: with SMTP id i22-v6mr1826911pgl.86.1535421278873; Mon, 27 Aug 2018 18:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535421278; cv=none; d=google.com; s=arc-20160816; b=djeT0XWQsuJfdf2iGAsXNw5glHAv0sPeJObR2xmSplc1QcRIqStKd+r7+nRqrAdKtg XsNZOGin89ofNITwbEC0yGmJ+hCwsqVGwtghCrrFLr2rRvu//sf0BizaoiVXqq7Q6I+I kLg/CunxtTqNjLlPQSeIHLXxjvTV8zwVT/yVjw4UPLJ47VeGa9w0p+kzu3rnjeUaZDys jbDQok9DhG4l62EQEfmyDkTJHt/hCJVQHyslCxs+s5goz5ua3OzGSq4oQuJm051lILp9 sg21L7ZVLzbO9ymEP6ZNsz0ad7DOaxEjPvNFgRXmjYA6r6m5+A0aZjgRjzzBCMOwsZX/ 74FQ== 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:arc-authentication-results; bh=Xulus8zSDvpYwpbHR5AcJKSXwBqS55HrQS4eGyYdJbc=; b=tM80NnJwcLhVqxEKrZgPwAcIISOmAzAX/pZfV6v2hvN9QpuqdSDv3dh1bAhIJRdW+V 8HwzBM8RWen6wPTzQVBphYt2o0mTakUwKtoULAtFbZy7faErIJIGmyBjlOpI0JmzVKTb h7UFzsbAWvdoLK5llzmkwPXyrgtm4r7wta0zuZH1SoaK1Aw005UaWOM6WeDairadWLMz geC9Zb3Y0cXMLXbudEqfqgRCzmlqqqhC8RffGp6adpm3wr9FThzW4iF2Kps1fBVFm2Y/ jydwAAc0+3A90ckjMNkUZK5himm2r3UOck+U5iD/BXnr3RzCgMTz5wwade25VKwZB2Uo FXOw== 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; 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 97-v6si908100plm.290.2018.08.27.18.54.23; Mon, 27 Aug 2018 18:54:38 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727597AbeH1Fmb (ORCPT + 99 others); Tue, 28 Aug 2018 01:42:31 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:39556 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727530AbeH1Fma (ORCPT ); Tue, 28 Aug 2018 01:42:30 -0400 Received: by mail-oi0-f68.google.com with SMTP id c190-v6so9265oig.6; Mon, 27 Aug 2018 18:53:15 -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:in-reply-to :references; bh=Xulus8zSDvpYwpbHR5AcJKSXwBqS55HrQS4eGyYdJbc=; b=YNnSWrXIae6avmFAv39vUYtTMDIBa0c6JiKp6NAO853CodUBpVaJLz+wMuB4rI2d4P TZ0OfyJfuuy0uMiTBY7ttc4tqX3dchwGFkR/TdElmyqcKiOyatHlE/XpGDpTWUnGZo+J aqt44/RtnWrsG6ZqeKFAComwHjUJZsMd7bn8dRFAVvwpTbDf7PiXx3DkyV5HrPnH1wkV lFm2+C8OxVLPn4eX0mnTMYXmzQ2hxosHRizMQgLXY3HpwqG9gSvnkzEvyQE90NKBa+zt A3BPvZansTL+YR/NG08dN4z0TLeq7kA2vJ/FYOGQ2mAoZcy6ZhKHt+b9JbrKAeClZpSL zU7Q== X-Gm-Message-State: APzg51DMxjof8ct/V7p3HiIxgjoEzaRY0Cas+C7znnR3mIu+Ar77pXLV t88AlsWlsq1UM1Cre9XAqsZdulQ= X-Received: by 2002:aca:3507:: with SMTP id c7-v6mr1198850oia.46.1535421194751; Mon, 27 Aug 2018 18:53:14 -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 n71-v6sm1652696oig.48.2018.08.27.18.53.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 18:53:14 -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] i2c: Convert to using %pOFn instead of device_node.name Date: Mon, 27 Aug 2018 20:52:22 -0500 Message-Id: <20180828015252.28511-21-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180828015252.28511-1-robh@kernel.org> References: <20180828015252.28511-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- drivers/i2c/busses/i2c-powermac.c | 15 ++++++++------- drivers/i2c/muxes/i2c-mux-gpmux.c | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c index f2a2067525ef..b706fd136ca5 100644 --- a/drivers/i2c/busses/i2c-powermac.c +++ b/drivers/i2c/busses/i2c-powermac.c @@ -390,7 +390,6 @@ 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 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; } -- 2.17.1