From patchwork Tue Sep 4 18:43:52 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: 145939 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4011580ljw; Tue, 4 Sep 2018 11:43:58 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaX5Gq9D1kMMZC0YdYieW38BET+0kTNg8Og8jBlHtmSl+y+G131auN46yhH+25Cy0AHwtQT X-Received: by 2002:a17:902:24e:: with SMTP id 72-v6mr35058640plc.74.1536086638613; Tue, 04 Sep 2018 11:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536086638; cv=none; d=google.com; s=arc-20160816; b=zDco/K9fk8f76vYV2oQSx5cBD1cnSc0wYN0efGHr5/7FTqU2QA5XSOLUnXip3s3dNF N69+Nr0lB7SeDp2aceOsdKOqMyXQAM9eIxO52EXXVU+XwR6+CyUe5hDKqDfoTE8v1sOM tt3O9OXe9R+W7WxDYpPRgLSNhNDAMVS85a/big28XQQrzbk2TqiiKR9bn2FkZCtNZUsY 9KBdmNT8OuF5R1QqWfCPRtQUOFpTNY8xBKzb9imYh2gkzoNNG7L9D5voNhSFCksgQqv1 W7l6kaAFg4fH5lHWuME4tHeOZZYQuE6qXWavy+P4fbTwVNnYIM4GAR1Hn4rd5Qb667x+ DQ0A== 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 :arc-authentication-results; bh=UBCx+t3u4c1JDIZsYjCAOjy+ve8hYOVH2wrUJCyxb7A=; b=CwETH+Gdev+aqEN112ELYsv3tmaNldp5eBtBchqgU7stRt3ke9HKR5MMXqgEKp1tYT joHJv/hscVCQKYoX6jb0ZKQp44j2d6nP2FLIQAIXJlyYzKDLK1h3mxnYkIIwYFnuhhmo kAUuLcSD+xW5ahlJG+GMpy8c7yD8K90supgq4/DqXCUJ2jzf+zbWSWdRSpWSX770EQcH fQ+5JxSFpZ9N067ZBu+g/75SkkFyPX87WbFRnrxdvaGgeplHqC8wRstxdHS0VRza2HKe Az2g4N9XxjtJc359zKsJ2vfhtzI4o4xpcUSqpXTJbsup54mQqK+yRgtCjeoGznO1+gRF ITLQ== 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 k17-v6si23354219pfj.321.2018.09.04.11.43.58; Tue, 04 Sep 2018 11:43:58 -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 S1727818AbeIDXKQ (ORCPT + 32 others); Tue, 4 Sep 2018 19:10:16 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:41738 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726507AbeIDXKQ (ORCPT ); Tue, 4 Sep 2018 19:10:16 -0400 Received: by mail-oi0-f67.google.com with SMTP id k12-v6so8708716oiw.8 for ; Tue, 04 Sep 2018 11:43:54 -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=UBCx+t3u4c1JDIZsYjCAOjy+ve8hYOVH2wrUJCyxb7A=; b=qbH2SH2Gz9cb1U+BBgscc8oGE0ojmt6hngrpHi0ZhMWBtoMoaLFu+bDVc0RoGoZ8YH DpjJY0JSqiPciWMFJWx+Ovfhf9mXAGXMaiS+CSmOvgQ60jeZ/V5w6K8eIAEDCk82kvu4 /OGyOeA/7mRpVGCSHxIOV4AuEhKlF1Ii1AyrJ6IMAuPLYJFXSwuplEahW+jIvbwuRd1C r78jvKo/ze8QoILz6mGM7rsuBVWJblkIoo3nF7i/sPZX/q3CT68VqMr3elRYYgtTaHxs FIi0IJOhhD55WZsaV5PnX8Re+PoALdMzIZOLzP8AvOmdg6FTnLItEXIwF6aKwT1+2UBd FotA== X-Gm-Message-State: APzg51CTrOGjfoV5yl2x3+Q9yz03psx6IOK+V1gkVO8GJayE4owno8zI qownsxaZFd5106TmivBdL44bKgg= X-Received: by 2002:aca:ab0c:: with SMTP id u12-v6mr24556923oie.143.1536086633917; Tue, 04 Sep 2018 11:43:53 -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 r81-v6sm15543449oih.28.2018.09.04.11.43.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Sep 2018 11:43:53 -0700 (PDT) From: Rob Herring To: linux-kernel@vger.kernel.org Cc: Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2] macintosh: Convert to using %pOFn instead of device_node.name Date: Tue, 4 Sep 2018 13:43:52 -0500 Message-Id: <20180904184352.7836-1-robh@kernel.org> X-Mailer: git-send-email 2.17.1 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: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring --- v2: Add setting dev_name in macio_asic.c drivers/macintosh/macio_asic.c | 8 ++++---- drivers/macintosh/macio_sysfs.c | 8 +++++++- drivers/macintosh/windfarm_smu_controls.c | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index 07074820a167..cf2d3b3dd599 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c @@ -403,19 +403,19 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, /* MacIO itself has a different reg, we use it's PCI base */ if (np == chip->of_node) { - dev_set_name(&dev->ofdev.dev, "%1d.%08x:%.*s", + dev_set_name(&dev->ofdev.dev, "%1d.%08x:%.*pOFn", chip->lbus.index, #ifdef CONFIG_PCI (unsigned int)pci_resource_start(chip->lbus.pdev, 0), #else 0, /* NuBus may want to do something better here */ #endif - MAX_NODE_NAME_SIZE, np->name); + MAX_NODE_NAME_SIZE, np); } else { reg = of_get_property(np, "reg", NULL); - dev_set_name(&dev->ofdev.dev, "%1d.%08x:%.*s", + dev_set_name(&dev->ofdev.dev, "%1d.%08x:%.*pOFn", chip->lbus.index, - reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name); + reg ? *reg : 0, MAX_NODE_NAME_SIZE, np); } /* Setup interrupts & resources */ diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c index ca4fcffe454b..d2451e58acb9 100644 --- a/drivers/macintosh/macio_sysfs.c +++ b/drivers/macintosh/macio_sysfs.c @@ -58,7 +58,13 @@ static ssize_t devspec_show(struct device *dev, static DEVICE_ATTR_RO(modalias); static DEVICE_ATTR_RO(devspec); -macio_config_of_attr (name, "%s\n"); +static ssize_t name_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + return sprintf(buf, "%pOFn\n", dev->of_node); +} +static DEVICE_ATTR_RO(name); + macio_config_of_attr (type, "%s\n"); static struct attribute *macio_dev_attrs[] = { diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c index d174c7437337..86d65462a61c 100644 --- a/drivers/macintosh/windfarm_smu_controls.c +++ b/drivers/macintosh/windfarm_smu_controls.c @@ -277,7 +277,7 @@ static int __init smu_controls_init(void) fct = smu_fan_create(fan, 0); if (fct == NULL) { printk(KERN_WARNING "windfarm: Failed to create SMU " - "RPM fan %s\n", fan->name); + "RPM fan %pOFn\n", fan); continue; } list_add(&fct->link, &smu_fans); @@ -296,7 +296,7 @@ static int __init smu_controls_init(void) fct = smu_fan_create(fan, 1); if (fct == NULL) { printk(KERN_WARNING "windfarm: Failed to create SMU " - "PWM fan %s\n", fan->name); + "PWM fan %pOFn\n", fan); continue; } list_add(&fct->link, &smu_fans);