From patchwork Fri Jan 11 15:19:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 10761353 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 504511580 for ; Sun, 13 Jan 2019 16:53:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E82F2889E for ; Sun, 13 Jan 2019 16:53:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 330B528995; Sun, 13 Jan 2019 16:53:11 +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 D94682889E for ; Sun, 13 Jan 2019 16:53:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 51AD46E517; Sun, 13 Jan 2019 16:52:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on0727.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::727]) by gabe.freedesktop.org (Postfix) with ESMTPS id 87C346F765 for ; Fri, 11 Jan 2019 15:19:14 +0000 (UTC) Received: from AM6PR02MB4470.eurprd02.prod.outlook.com (20.177.191.218) by AM6PR02MB3735.eurprd02.prod.outlook.com (52.134.113.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.13; Fri, 11 Jan 2019 15:19:11 +0000 Received: from AM6PR02MB4470.eurprd02.prod.outlook.com ([fe80::e5f3:a239:2ec4:4453]) by AM6PR02MB4470.eurprd02.prod.outlook.com ([fe80::e5f3:a239:2ec4:4453%6]) with mapi id 15.20.1516.016; Fri, 11 Jan 2019 15:19:11 +0000 From: Peter Rosin To: "linux-kernel@vger.kernel.org" Subject: [PATCH v4 4/5] drm/bridge: lvds-encoder: add dev helper variable in .probe() Thread-Topic: [PATCH v4 4/5] drm/bridge: lvds-encoder: add dev helper variable in .probe() Thread-Index: AQHUqcEAzPFcqEwkg0i7hxnCwqBC8g== Date: Fri, 11 Jan 2019 15:19:10 +0000 Message-ID: <20190111151843.11114-5-peda@axentia.se> References: <20190111151843.11114-1-peda@axentia.se> In-Reply-To: <20190111151843.11114-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: HE1PR07CA0035.eurprd07.prod.outlook.com (2603:10a6:7:66::21) To AM6PR02MB4470.eurprd02.prod.outlook.com (2603:10a6:20b:60::26) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR02MB3735; 6:NC4DHMn33byVV4p2aypkNqxAZ9g0yy5pdW5uHxY0Sx64XFavQNmyaDGGRf6PqxqAq+StO6rFPT/2rVFsSCdd7fjZQVxLWRL96dkSfKjBfwx/0NGgTczQZL7DynjAYnKuEweB15Nlvju30/F65PjrRZxwLGC0pF9OtpE8VKv6SX8Mn9r3HaCJHVmZCCn/9GWfiUAPGjWqxQKj1ixfkS/d9c6uRrZZJY2+CxqPIu18nEi0WHdNyF/W6FvCgnxjQ0eNsF+Y1CyEwJtiug0pSGIbUzKvs+7W0Ru9YSnCUFDJlFSTzCz5bqD5LpoJsShp4taq8WtCxTprM0sPDNijpXXT6MdCJvsJj84/yAmaOWQrqmOHJ4wewTMB8miE4dgZOUJz5IC1sXmcdtKGUKir72XdLRat5f5LkucJ2cP5udPdSUkLYqUoUC6g9xCQvgQ8BJ8x4bg430ihQV5TEh5sUSDaig==; 5:x0/1C/XdtqdafRfd8oK/4cfTX8SqfKPnNs3H7pmQg7lhRaYPEqjaRfKneYrzj5kP+J8lfXje5bZXZn6r2h9nkO5fYMOVyGGzQb0hlhxVSmJmdxNTn9Y3BOlkDvzb/XbVS5LyfzMWErg1A+8qgpSsfXYSvxNb3I/Ef28kZE46ZYTyFMt+6qUwnCD0XnyOCRqk2IxjeAu66bTJIIKIQkKphQ==; 7:sI9bQgbe8C8yoA/Ohe9WLvNq7GcwiKgF87gBYpmDOeNF3ZzQ8RZnL8FHAz1N19vWSkG65EhD0QDhBlqebpt8pVHBVKkdBE87T4/Ku8JW4w8vgi2nH9Sgifnx+ozdK8xiZfJ+gcMh4q/Wo0G1CEjvjQ== x-ms-office365-filtering-correlation-id: 6f6c1386-730d-497a-ef80-08d677d82305 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600109)(711020)(2017052603328)(7153060)(7193020); SRVR:AM6PR02MB3735; x-ms-traffictypediagnostic: AM6PR02MB3735: x-microsoft-antispam-prvs: x-forefront-prvs: 09144DB0F7 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(376002)(366004)(346002)(136003)(39830400003)(189003)(199004)(2501003)(1076003)(14454004)(99286004)(54906003)(508600001)(5640700003)(68736007)(6436002)(97736004)(2906002)(71190400001)(2351001)(106356001)(6486002)(316002)(105586002)(71200400001)(86362001)(575784001)(386003)(6506007)(102836004)(66066001)(6116002)(52116002)(76176011)(3846002)(6512007)(53936002)(2616005)(11346002)(476003)(446003)(74482002)(8676002)(81156014)(81166006)(186003)(486006)(5024004)(256004)(26005)(50226002)(8936002)(305945005)(7736002)(5660300001)(6916009)(25786009)(4326008)(36756003)(142923001); DIR:OUT; SFP:1102; SCL:1; SRVR:AM6PR02MB3735; H:AM6PR02MB4470.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: TkcZfvtRRMm05BV51USo0p23BUQVaK8b7F6pSEd/+5hg9aeWwJMhMFIt616LXO54RlLdj+/+BfUfTrZ2h5ekq5GKSQl85xV4c8tD1LcPA17cTXTAd4xVMFsZfE9v+XyHnlU1MgqAE4cx6T4qybm4ThP+NSQUGDw29RudR34onqEEL16l55ANkn+O0j8Z5F84s1PhA8lE6NxIvmyoIzgexb/R1Z9SRfSw7xWVmk2JAyEweqUFp9a/0833QLEswJwZ9flk3iwqiSDjRyum8zWHUtIR/0XJNKlNT2/OzpDiha5y4zpC+IemNRbYd025aupHUnc+DuKAX0gYjxoE5MO3fhPYLpaAE0y7peAA56yChLFFIxAQ6OuTjj+6XJ2behOyE0iQFSANq6jzHRo5uW03ci7SNKoNmRfTIIuq1gSafz0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-Network-Message-Id: 6f6c1386-730d-497a-ef80-08d677d82305 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2019 15:19:09.7412 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR02MB3735 X-Mailman-Approved-At: Sun, 13 Jan 2019 16:52:57 +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: Andrzej Hajda --- 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);