From patchwork Sat Dec 29 07:07:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 10745979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F427746 for ; Tue, 1 Jan 2019 21:47:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91066286A7 for ; Tue, 1 Jan 2019 21:47:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 852B4287AB; Tue, 1 Jan 2019 21:47:21 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1A53C286A7 for ; Tue, 1 Jan 2019 21:47:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7577F6E28C; Tue, 1 Jan 2019 21:47:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40092.outbound.protection.outlook.com [40.107.4.92]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8FF2A6E0A6 for ; Sat, 29 Dec 2018 07:07:40 +0000 (UTC) Received: from AM0PR0202MB3267.eurprd02.prod.outlook.com (52.133.34.148) by AM0PR0202MB3459.eurprd02.prod.outlook.com (52.133.35.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Sat, 29 Dec 2018 07:07:37 +0000 Received: from AM0PR0202MB3267.eurprd02.prod.outlook.com ([fe80::cdf9:e79c:8ad0:7422]) by AM0PR0202MB3267.eurprd02.prod.outlook.com ([fe80::cdf9:e79c:8ad0:7422%5]) with mapi id 15.20.1471.019; Sat, 29 Dec 2018 07:07:37 +0000 From: Peter Rosin To: "linux-kernel@vger.kernel.org" Subject: [PATCH v3 4/5] drm/bridge: lvds-encoder: add dev helper variable in .probe() Thread-Topic: [PATCH v3 4/5] drm/bridge: lvds-encoder: add dev helper variable in .probe() Thread-Index: AQHUn0UtgZZip4D7Y0+gDT/zYJbnWw== Date: Sat, 29 Dec 2018 07:07:37 +0000 Message-ID: <20181229070649.21308-5-peda@axentia.se> References: <20181229070649.21308-1-peda@axentia.se> In-Reply-To: <20181229070649.21308-1-peda@axentia.se> Accept-Language: en-US, sv-SE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.11.0 x-originating-ip: [85.226.244.23] x-clientproxiedby: HE1PR0502CA0002.eurprd05.prod.outlook.com (2603:10a6:3:e3::12) To AM0PR0202MB3267.eurprd02.prod.outlook.com (2603:10a6:208:5::20) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR0202MB3459; 6:CADVE5MvwxUF8NS1560jT3gRBGoNfUBak1IShl81Uip2/LRk6EecyHRQ6DxTZsaKUPUHdeVuamYgHIvFwDjtr+IEy4Rlui9zyJP+YyIKL6S7Pp9SxxHh6GMGqYqad2ZG2Iex7gwvcUfPC/6UMMsvzkYiLYF3FCWtcTXYxrCfNuYbbykH8emXlIir1WPXO838v4TFLHAWjBEXFRgs3vk0wS3EcbN4HBSm90VBL5oIwruUuWuCdcZE5lRQIC8tI2lL0MgqfWSLHBpq8BpbwPCW5R4iw8HHG8NBen5odJ4Uo/MlpGMWQgoy9Po8jBlfUzMGRZ2hbSKGX3j3lVSAv31/rFVasg/3o+OeNfRwntLwjolmMFaudWDHtCPlfPvkJ8GqQCGDmcQNh0pFCAedYK1SO7A/GQC+i3hZxnODrHx7DtazBBgoUNg3bBj76SfZ72oS3M/IpdqxFA1oC4B+tNzshg==; 5:+mudUt6wyPi8820lxQwbmu+/OMG2aOuuKMmVPJBz2wdsursr0eAmVvpCtN4ehMcU25BYpuXydbt0XvR0IyLGTk4V9qYWfBQFbwLB28j+M7EOVAfmNy5xx6+JDGxs4dmhgT5PpurDvK0Ry+ByXodAkhoADcaP50b27090iXEbHZw=; 7:h2xBzv8Y656PkZQf8nYSOmcTpUCURT8gGtSu/KRP1GdAToG5f2jP+g73EZMN2d8l9XigW7p63gh4Hyog3zL9bi950kcSgHWSm48UtrSDQncPIAqxOFuf6gPRlgfsfVGzO0Rsfei1+YCdQy0sbzSSYw== x-ms-office365-filtering-correlation-id: c420e574-c896-4e11-d79e-08d66d5c503a x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(5600109)(711020)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(2017052603328)(7153060)(7193020); SRVR:AM0PR0202MB3459; x-ms-traffictypediagnostic: AM0PR0202MB3459: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(3230021)(908002)(999002)(5005026)(6040522)(8220055)(2401047)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231475)(944501520)(52105112)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(2016111802025)(6043046)(201708071742011)(7699051)(76991095); SRVR:AM0PR0202MB3459; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0202MB3459; x-forefront-prvs: 09011458FC x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(366004)(346002)(39830400003)(136003)(189003)(199004)(71200400001)(71190400001)(66066001)(6916009)(5024004)(305945005)(99286004)(8676002)(81166006)(106356001)(6116002)(6436002)(81156014)(7736002)(2616005)(1076003)(86362001)(575784001)(2906002)(6486002)(8936002)(476003)(74482002)(54906003)(3846002)(256004)(446003)(11346002)(486006)(68736007)(50226002)(186003)(5660300001)(316002)(36756003)(14454004)(6506007)(6512007)(508600001)(76176011)(2351001)(52116002)(97736004)(26005)(4326008)(5640700003)(386003)(25786009)(53936002)(102836004)(105586002)(2501003)(142923001); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR0202MB3459; H:AM0PR0202MB3267.eurprd02.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ezQzJYeJEX44jZcxTit++2WidcgfkmBM7jmNqTgncC5nVSv1PlBSi4Th5yhimeel+GzsbESVdlhEZhL50tgLTS65HanQ0jtGwikpEmjOl3ThI4ZR76wBhyfMRKhZeuU5vkDBCkdEcOI11FjF+PVlr9X75VRrg5RHWuxDpBycnXHVCRrrwjDTIX9ObnpM6CnfvFXPcjqQwat1Vdy+AfNWurpuHXCAVWAGDCzeqBzhNiB0nZIvxHRhLqmN3lzM+WUIg3gKNEOX8f4oS4uiJJZgV7fzob1+2qOH/MY8IdLBtuQcUMJ7MPMp5YH6f2vpEx2z spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-Network-Message-Id: c420e574-c896-4e11-d79e-08d66d5c503a X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Dec 2018 07:07:37.3278 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0202MB3459 X-Mailman-Approved-At: Tue, 01 Jan 2019 21:47:02 +0000 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: Mark Rutland , "devicetree@vger.kernel.org" , David Airlie , "dri-devel@lists.freedesktop.org" , Rob Herring , Laurent Pinchart , Peter Rosin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Make the code easier to read and modify. Signed-off-by: Peter Rosin Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/lvds-encoder.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/lvds-encoder.c b/drivers/gpu/drm/bridge/lvds-encoder.c index 75b0d3f6e4de..f6770e83d49d 100644 --- a/drivers/gpu/drm/bridge/lvds-encoder.c +++ b/drivers/gpu/drm/bridge/lvds-encoder.c @@ -34,48 +34,47 @@ static struct drm_bridge_funcs funcs = { static int lvds_encoder_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct device_node *port; struct device_node *endpoint; struct device_node *panel_node; struct drm_panel *panel; struct lvds_encoder *lvds_encoder; - lvds_encoder = devm_kzalloc(&pdev->dev, sizeof(*lvds_encoder), - GFP_KERNEL); + lvds_encoder = devm_kzalloc(dev, sizeof(*lvds_encoder), GFP_KERNEL); if (!lvds_encoder) return -ENOMEM; /* Locate the panel DT node. */ - port = of_graph_get_port_by_id(pdev->dev.of_node, 1); + port = of_graph_get_port_by_id(dev->of_node, 1); if (!port) { - dev_dbg(&pdev->dev, "port 1 not found\n"); + dev_dbg(dev, "port 1 not found\n"); return -ENXIO; } endpoint = of_get_child_by_name(port, "endpoint"); of_node_put(port); if (!endpoint) { - dev_dbg(&pdev->dev, "no endpoint for port 1\n"); + dev_dbg(dev, "no endpoint for port 1\n"); return -ENXIO; } panel_node = of_graph_get_remote_port_parent(endpoint); of_node_put(endpoint); if (!panel_node) { - dev_dbg(&pdev->dev, "no remote endpoint for port 1\n"); + dev_dbg(dev, "no remote endpoint for port 1\n"); return -ENXIO; } panel = of_drm_find_panel(panel_node); of_node_put(panel_node); if (!panel) { - dev_dbg(&pdev->dev, "panel not found, deferring probe\n"); + dev_dbg(dev, "panel not found, deferring probe\n"); return -EPROBE_DEFER; } lvds_encoder->panel_bridge = - devm_drm_panel_bridge_add(&pdev->dev, - panel, DRM_MODE_CONNECTOR_LVDS); + devm_drm_panel_bridge_add(dev, panel, DRM_MODE_CONNECTOR_LVDS); if (IS_ERR(lvds_encoder->panel_bridge)) return PTR_ERR(lvds_encoder->panel_bridge); @@ -83,7 +82,7 @@ static int lvds_encoder_probe(struct platform_device *pdev) * but we need a bridge attached to our of_node for our user * to look up. */ - lvds_encoder->bridge.of_node = pdev->dev.of_node; + lvds_encoder->bridge.of_node = dev->of_node; lvds_encoder->bridge.funcs = &funcs; drm_bridge_add(&lvds_encoder->bridge);