From patchwork Tue Aug 28 01:52:50 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: 145274 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp609916ljw; Mon, 27 Aug 2018 18:55:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZy0dYXWxQqtF3PMA74hkpvGWYghdhCnJoTRcZiz9rQvfQrPwcejEMlklK2mP0enWyzaWab X-Received: by 2002:a17:902:1ab:: with SMTP id b40-v6mr15799007plb.55.1535421324602; Mon, 27 Aug 2018 18:55:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535421324; cv=none; d=google.com; s=arc-20160816; b=fO1QUZMomosnRb1F/ZsKEBK1ZPLhL11NmLWNWFygpQzfzT9HiXAEX9WoZlooTrAi/d jqYedGOsY0z6A82XuCimWiHELRFTQXfIGdmGsM4peoAUEaYpsoLyK2Z+vrrS+reZRQZV q7KT80978xDn2w3r9+sBxU6+t+8Rjzh6U7MjL2jdFFs4Dh4xjXbOTd4d5RYjpF1c5wpa 6vJgCW+l7TXfP40JPse04NV0mRTZPOtbBOVOR1SHh7wxhRO2RbkelbMrjGBUc269YMWx 18NHml4GKVObpl6ID74l2EndrRuA8wEr0fk+1I2+Mvsg4GObllihkkNknrc7ORSVvail YWpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:delivered-to:arc-authentication-results; bh=OTLCumJ0QUdssJkoI7zb/fSb/N5l/MWvJHEawXPWJ1U=; b=QB36mpdt5K7SmtebrS7J5bBNTEp6NPin8IApIARBVOeZyEdOSbYFk/cMazGzo6/0a4 27Qt9k1mq5F4BEWhG0dG2HZ7AXiyIgNbaM1fFD8dittJwqh7kAD4l49ZYQfLbBZv9GUx ij/g2b2w1GO43pkMxm7Ib04jreGG++MA5pLTFCMwShhRI6XnlgUElc/fFV5EPQ+KeGVt tnmMnUjrRj1f6+NsMdKPX5E2ni7yEmIIIXzuyhLwt6PSz/PlsreojMmk4RNszBgl2EN9 8hK5nOc0YKhHszLpm3myM4j9tzhfkjf8o2NE6bhv+Ob5FtEQ9G+Lru7RfiaJVNYc76pN tp8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id n6-v6si883983pla.398.2018.08.27.18.55.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Aug 2018 18:55:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E0416E2D6; Tue, 28 Aug 2018 01:55:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oi0-f65.google.com (mail-oi0-f65.google.com [209.85.218.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 669A86E2D2 for ; Tue, 28 Aug 2018 01:55:18 +0000 (UTC) Received: by mail-oi0-f65.google.com with SMTP id c190-v6so16056oig.6 for ; Mon, 27 Aug 2018 18:55:18 -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=6GXlxyXUgbelAbEjAaxb7b0y+0sJFbxQbtsrd2YVPQo=; b=Xlkb6k0osDfl7Co8iB9qsMItYAdo6PzPFpp37GxIXXc4fefDFYN/RB8Jhd2hGO5Bds +MjiV0mKYeKddpNBdzE6XfLwbxczpaJ2iJqeolVxALgW7J77Cls8MLHyMm0spTD/goLw iaruqtuHPbIVF/Ot1eNHtYUIYw4f0VSy+i2IyVgdQByqNzVSg6WQng55azZ5PeImNNfL rxwOWkxMKX/Kbc4Sd8z7PiumcoL5RGEC0rRWzEKhlOpMvMYkA14stxd8b6sxXSOuhYPA CXEshRmomK+J/iowAHtHfqa37M5BkwAJAtGknmAeetdA9yOnpm5FEPo1uOPDQ2gTNrAE AzZg== X-Gm-Message-State: APzg51Dtz90AAkncz3moSXLvasNpohzmgIdxOiM3jep6xe7uWA92TUns ne69iOLxRYYgnFliKMYxFQ== X-Received: by 2002:aca:3507:: with SMTP id c7-v6mr1204742oia.46.1535421317711; Mon, 27 Aug 2018 18:55:17 -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.55.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 18:55:17 -0700 (PDT) From: Rob Herring To: linux-kernel@vger.kernel.org Subject: [PATCH] fbdev: Convert to using %pOFn instead of device_node.name Date: Mon, 27 Aug 2018 20:52:50 -0500 Message-Id: <20180828015252.28511-49-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> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. Cc: Bartlomiej Zolnierkiewicz Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Signed-off-by: Rob Herring --- drivers/video/fbdev/cg14.c | 4 +--- drivers/video/fbdev/cg3.c | 2 +- drivers/video/fbdev/core/fbmon.c | 4 ++-- drivers/video/fbdev/imsttfb.c | 2 +- drivers/video/fbdev/leo.c | 2 +- drivers/video/fbdev/offb.c | 12 ++++++++---- drivers/video/fbdev/p9100.c | 2 +- drivers/video/of_display_timing.c | 2 +- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/video/fbdev/cg14.c b/drivers/video/fbdev/cg14.c index 8de88b129b62..9af54c2368fd 100644 --- a/drivers/video/fbdev/cg14.c +++ b/drivers/video/fbdev/cg14.c @@ -355,9 +355,7 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) static void cg14_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) { - const char *name = dp->name; - - strlcpy(info->fix.id, name, sizeof(info->fix.id)); + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp); info->fix.type = FB_TYPE_PACKED_PIXELS; info->fix.visual = FB_VISUAL_PSEUDOCOLOR; diff --git a/drivers/video/fbdev/cg3.c b/drivers/video/fbdev/cg3.c index 6c334260cf53..1bd95b02f3aa 100644 --- a/drivers/video/fbdev/cg3.c +++ b/drivers/video/fbdev/cg3.c @@ -246,7 +246,7 @@ static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) static void cg3_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) { - strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp); info->fix.type = FB_TYPE_PACKED_PIXELS; info->fix.visual = FB_VISUAL_PSEUDOCOLOR; diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c index 852d86c1c527..dd3128990776 100644 --- a/drivers/video/fbdev/core/fbmon.c +++ b/drivers/video/fbdev/core/fbmon.c @@ -1480,8 +1480,8 @@ int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb, if (ret) return ret; - pr_debug("%pOF: got %dx%d display mode from %s\n", - np, vm.hactive, vm.vactive, np->name); + pr_debug("%pOF: got %dx%d display mode\n", + np, vm.hactive, vm.vactive); dump_fb_videomode(fb); return 0; diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c index ecdcf358ad5e..901ca4ed10e9 100644 --- a/drivers/video/fbdev/imsttfb.c +++ b/drivers/video/fbdev/imsttfb.c @@ -1473,7 +1473,7 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) dp = pci_device_to_OF_node(pdev); if(dp) - printk(KERN_INFO "%s: OF name %s\n",__func__, dp->name); + printk(KERN_INFO "%s: OF name %pOFn\n",__func__, dp); else if (IS_ENABLED(CONFIG_OF)) printk(KERN_ERR "imsttfb: no OF node for pci device\n"); diff --git a/drivers/video/fbdev/leo.c b/drivers/video/fbdev/leo.c index 71862188f528..446ac3364bad 100644 --- a/drivers/video/fbdev/leo.c +++ b/drivers/video/fbdev/leo.c @@ -434,7 +434,7 @@ static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) static void leo_init_fix(struct fb_info *info, struct device_node *dp) { - strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp); info->fix.type = FB_TYPE_PACKED_PIXELS; info->fix.visual = FB_VISUAL_TRUECOLOR; diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index 77c0a2f45b3b..31f769d67195 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c @@ -419,9 +419,13 @@ static void __init offb_init_fb(const char *name, var = &info->var; info->par = par; - strcpy(fix->id, "OFfb "); - strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb ")); - fix->id[sizeof(fix->id) - 1] = '\0'; + if (name) { + strcpy(fix->id, "OFfb "); + strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb ")); + fix->id[sizeof(fix->id) - 1] = '\0'; + } else + snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp); + var->xres = var->xres_virtual = width; var->yres = var->yres_virtual = height; @@ -644,7 +648,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node) /* kludge for valkyrie */ if (strcmp(dp->name, "valkyrie") == 0) address += 0x1000; - offb_init_fb(no_real_node ? "bootx" : dp->name, + offb_init_fb(no_real_node ? "bootx" : NULL, width, height, depth, pitch, address, foreign_endian, no_real_node ? NULL : dp); } diff --git a/drivers/video/fbdev/p9100.c b/drivers/video/fbdev/p9100.c index 64de5cda541d..c4283e9e95af 100644 --- a/drivers/video/fbdev/p9100.c +++ b/drivers/video/fbdev/p9100.c @@ -239,7 +239,7 @@ static int p9100_ioctl(struct fb_info *info, unsigned int cmd, static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) { - strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp); info->fix.type = FB_TYPE_PACKED_PIXELS; info->fix.visual = FB_VISUAL_PSEUDOCOLOR; diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index 5244e93ceafc..c2e7aa103fa5 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c @@ -170,7 +170,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np) goto entryfail; } - pr_debug("%pOF: using %s as default timing\n", np, entry->name); + pr_debug("%pOF: using %pOFn as default timing\n", np, entry); native_mode = entry;