From patchwork Sun Sep 4 04:26:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 9312363 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 4AA2360760 for ; Sun, 4 Sep 2016 04:33:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2655E289B5 for ; Sun, 4 Sep 2016 04:33:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06B95289BE; Sun, 4 Sep 2016 04:33:49 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 4882C289B5 for ; Sun, 4 Sep 2016 04:33:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750744AbcIDEdr (ORCPT ); Sun, 4 Sep 2016 00:33:47 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:38330 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750784AbcIDEdo (ORCPT ); Sun, 4 Sep 2016 00:33:44 -0400 Received: from trochilidae.lan (unknown [IPv6:2601:602:8802:504f:3e97:eff:fe92:db3b]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 9D5955C1A49; Sun, 4 Sep 2016 06:21:32 +0200 (CEST) From: Stefan Agner To: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com Cc: robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Agner Subject: [PATCH] video: mxsfb: get supply regulator optionally Date: Sat, 3 Sep 2016 21:26:27 -0700 Message-Id: <20160904042627.30182-1-stefan@agner.ch> X-Mailer: git-send-email 2.9.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1472962894; bh=XIn95f8eKNGyeyl/jYFgaWH30xXGg5j5jn6D87BPCvo=; h=From:To:Cc:Subject:Date:Message-Id; b=P0v5as7mLoZop/3cAUv2N0oPmuH2skH467DfaAbxy+fnX6RNCFS3l4S/SJnKnn10BjilfVpiMYJMu8+zaXGfzqtfkmHRNEhu7r/GvatIPat9toa1uCPKeDoRBmxy8yoOnc2ScLkFlW2JG5LnFc7LD8adnxt4hyQbc551YQGqLV4= 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 The lcd-supply is meant to be optional, there are several device- trees not specifying it and the code handles error values silently. Therefor, avoid creating a dummy regulator (and the associated warning) by using devm_regulator_get_optional. While at it, document that fact also in the device-tree bindings. Signed-off-by: Stefan Agner Acked-by: Rob Herring --- Documentation/devicetree/bindings/display/mxsfb.txt | 3 +++ drivers/video/fbdev/mxsfb.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/mxsfb.txt b/Documentation/devicetree/bindings/display/mxsfb.txt index 96ec517..0bc530f 100644 --- a/Documentation/devicetree/bindings/display/mxsfb.txt +++ b/Documentation/devicetree/bindings/display/mxsfb.txt @@ -7,6 +7,9 @@ Required properties: - interrupts: Should contain lcdif interrupts - display : phandle to display node (see below for details) +Optional properties: +- lcd-supply: Regulator for LCD supply voltage. + * display node Required properties: diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c index 4e6608c..4f7570f 100644 --- a/drivers/video/fbdev/mxsfb.c +++ b/drivers/video/fbdev/mxsfb.c @@ -920,7 +920,7 @@ static int mxsfb_probe(struct platform_device *pdev) if (IS_ERR(host->clk_disp_axi)) host->clk_disp_axi = NULL; - host->reg_lcd = devm_regulator_get(&pdev->dev, "lcd"); + host->reg_lcd = devm_regulator_get_optional(&pdev->dev, "lcd"); if (IS_ERR(host->reg_lcd)) host->reg_lcd = NULL;