From patchwork Tue Aug 28 01:52:22 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: 145246 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp608418ljw; Mon, 27 Aug 2018 18:53:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaY5DOcSCjE4TUzcuka43WiIQa0Jjs0HCLFaFp1989kmNjYtsod1O4+vvCfZHIVSkWrOtAS X-Received: by 2002:a17:902:7e06:: with SMTP id b6-v6mr15708965plm.230.1535421198684; Mon, 27 Aug 2018 18:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535421198; cv=none; d=google.com; s=arc-20160816; b=auSWkKt4Uct6amdvKJ5+fNdstPWKb6o1Z8tOEkFC3V6mfqD8PzhE/ExoqoZ4kXbKN7 q5gHjALAR5kJoNYeRtfqHKg48gqOIeZbmMgW9jjVxV285ZFSi2PLGbwf2rGalR1CK9zT 8X+DkPm3pHIgY1Iz1J/EDDlMqAkT4YFZEvMH40+V6byOAAsTMqKTw9+PybHa0eSuu+2s 5PNFEpThWMajPg19h4zS/ssywekRNb4+QYWcfn0uOblLYAH+EZI64pfEndvjfvxfjPqj vFAEaeEgHInWM7Wcl/DRBK0pGVGnASOx/zIfZuSpgZdkxmWDJNjNWRiky8ZMPTzhYScW OrlQ== 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=PBuSFT6JC6OmGBwtXbsKiO9CYMmFqNhdlJ5X51Nfwt0W9eyprZiCbPdCWnbwiriTIN TErlPYkYwa/W/R5G7eoiL2IXvNYH23U9uqOtSm9ndQ0VAwUmn3d27c7MPdyvXcAV0Q7j 96e0ke6NKuZ2sePrfvZL8dg0F3IEX2YTbZHWnnaPuBdzGpA9BDzm109dGlHbfw6SFd6j ZiRUuno0VJyaHNw9Uq94cfJI7xtS6D6UB0GkBdTwPeIBDQHpTua3GH5lppVAXc5g1oJL p4km//NThmTSpCLrfh4Afj0NRJoFnEBbrCc1OC2DMgEOTnySHQL8DpGg5++N1ZbJdoSp PBiA== 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 y9-v6si876894pgi.691.2018.08.27.18.53.18; Mon, 27 Aug 2018 18:53:18 -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 S1727608AbeH1Fmb (ORCPT + 2 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-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 --- drivers/i2c/busses/i2c-powermac.c | 15 ++++++++------- drivers/i2c/muxes/i2c-mux-gpmux.c | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) -- 2.17.1 Reviewed-by: Peter Rosin 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; }