From patchwork Tue Jan 31 18:25:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 9547997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A5FF460425 for ; Tue, 31 Jan 2017 18:26:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 986D5282E8 for ; Tue, 31 Jan 2017 18:26:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D178283B3; Tue, 31 Jan 2017 18:26:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D739282E8 for ; Tue, 31 Jan 2017 18:26:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751731AbdAaSZ4 (ORCPT ); Tue, 31 Jan 2017 13:25:56 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36343 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751386AbdAaSZz (ORCPT ); Tue, 31 Jan 2017 13:25:55 -0500 Received: by mail-pf0-f195.google.com with SMTP id 19so29068172pfo.3; Tue, 31 Jan 2017 10:25:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=GpwpjD4v0vtEojuBi/UgsdqMXQ9fgVnM2ORu4B6i4P4=; b=skxA5rUVqx5EX6+XDrR4hBvvH+GMPAB5s0sKYaIp5uj2ZmLHgN8WtAdtw0AYBaQOLY kNBrhQkvKxWz+zzNiwoqMNw2eHODJ8Mc48Zn9NXR9iscoXAVZQw6ctTjflzupRuiBSan 7+fgjHcgLfHD2S32J1pbOK1FSK1J39br2dEdtfc0W3JBgoFB0ABMXByPOSoGmTTXGYW0 wX7cTCuO+3qQY46mPSON3Xdl0STOGOxI5Cj+YPcotBlKhHZJxn3K+qKMoL2tB/HcknYo vSn/y3Fz/dIqSaffqMURLIWLn96lqYPvQOOFZXkW99tFHIvcZ2hogYy0Tz5QsQrOz3tg EXXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=GpwpjD4v0vtEojuBi/UgsdqMXQ9fgVnM2ORu4B6i4P4=; b=GVVgo4NMVrUy20henkfyO4ScSsBxUs4UaW1kbD+/S6bpDwZSNNm2LAJ+VGqmSItMUd pP7VwAOQJ3TC289Lt54KgZxeNxqPO0TkMqe/zdQfKwNaTC5Gozt6BOemndzVVDj1NY7E WzHN4VAsTGc1Dm9j7atitWK/kWTvuser7QeTXzLPP1s2RavmjWuX/DB2dtRib2xNIi5O ooEukZ21Y9KEWpueOUVb+FAWtvuXaVIoETguxu3w5JmjHT6JTSG8rJxkxh9FUzT6cXMl cNT7nBS5xyMU8kHQxuc8bqwlbnMF9FalBZl9rlbTyq8Xoh3Au0PVm/7J0EeNdns3KJ2Y iOFg== X-Gm-Message-State: AIkVDXKwtA6kAsgdz2hRW0jRi1bW+4XmG0wclRdhY7ODL7qodsW3KJmpR2fQPQdIF9hrWQ== X-Received: by 10.99.238.69 with SMTP id n5mr31726845pgk.38.1485887139185; Tue, 31 Jan 2017 10:25:39 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1311:c0b7:99da:f3c5:7745]) by smtp.gmail.com with ESMTPSA id b75sm42904125pfb.90.2017.01.31.10.25.38 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 31 Jan 2017 10:25:38 -0800 (PST) Date: Tue, 31 Jan 2017 10:25:36 -0800 From: Dmitry Torokhov To: Bartlomiej Zolnierkiewicz Cc: Tomi Valkeinen , Yongji Xie , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] video: fbdev: offb: switch to using for_each_node_by_type Message-ID: <20170131182536.GA30076@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of open-coding loops let's switch to a nice macro. Signed-off-by: Dmitry Torokhov --- drivers/video/fbdev/offb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index 906c6e75c260..9be884b0c778 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c @@ -668,14 +668,14 @@ static int __init offb_init(void) offb_init_nodriver(of_chosen, 1); } - for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { + for_each_node_by_type(dp, "display") { if (of_get_property(dp, "linux,opened", NULL) && of_get_property(dp, "linux,boot-display", NULL)) { boot_disp = dp; offb_init_nodriver(dp, 0); } } - for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { + for_each_node_by_type(dp, "display") { if (of_get_property(dp, "linux,opened", NULL) && dp != boot_disp) offb_init_nodriver(dp, 0);