From patchwork Tue Jan 31 22:57:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 13123553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEB63C636CC for ; Tue, 31 Jan 2023 22:57:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC0A910E39E; Tue, 31 Jan 2023 22:57:22 +0000 (UTC) Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by gabe.freedesktop.org (Postfix) with ESMTPS id C193A10E39F for ; Tue, 31 Jan 2023 22:57:15 +0000 (UTC) Received: by mail-pl1-x633.google.com with SMTP id z1so9116879plg.6 for ; Tue, 31 Jan 2023 14:57:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q69dgLqN6kO5gAwOLys8/HsP5kHBTFUQsrWWIDgTKOA=; b=WlyQM2M1BRD/grSwpqjxowafQRbiTF3h/qMkf/UVUkLbjBuEdMjv/YbDWF3nXuur7J JCEAelUYFgODW5vL5AuDv6QOf0M3DbsAD/JGdQPzHgmeE7ntQ5+7RGUhF/4zRQ90Wicq n4jHkleJL3sHGKF/VrjyrrxqRNpKig2VyaDskDKO5fLtRJYZadqIYNMS0GHYQA+dRicp LPV2tCE3RYgEdwlxXKY4TucbW1z0acQjT0v9qi9MmWqjZY0XwdhXjjErQCugoCq9+jHa WGk7K3pdwkd0bkwOntpa0dCzo5qCLmdpYm03D8NPTFlk6NF8jwS67G0IcfsSt6bajPOJ 5NtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q69dgLqN6kO5gAwOLys8/HsP5kHBTFUQsrWWIDgTKOA=; b=MDHB3UCTTG85vhiWc8P0k/sxNT8xC7IvnPlZKBf3Cu/irfmBjXEOApRFnnBhPkH32W FCBUvvC64ryRnJU6Pb+FCPuHlL7m7zcv9wBRbtymHEa7C0opxh+CGDu5IOXqS2zLbNH3 FxVPN1L8BwqHPJN5t5L7Oo2ZMem7OiIPshlH6fMiCWdh6PXI2GUXXUo9RwFE4+/7GE6w Akb+JcKC4o7Jo0excJPGMQHfCbHSQn24diFJ34hOw4Pe/HeyRx6Lih5dZUFJw9zJzGDo v5Ip2TYsJ/nDkmYPxN29CR1z6KlY2wTxYFz0gyn7JKItmx7k78EIzUDiCBbFIQIzA5Gj M2Sg== X-Gm-Message-State: AO0yUKU+RSjdbIlL7/zLsz3vlOV2YY09TIQDzyvsMU3/qzr2vAWe5Xjr tx9CgNrA1AmLe9zKW8kcDSE= X-Google-Smtp-Source: AK7set9PKo7V/pKdXXqVAGSTAu7KzGfvjB03OhbiIWYP7LFi7RALAmjSfrliCkYrGmvTRSQ1DeTDpw== X-Received: by 2002:a17:903:2053:b0:194:3cef:31 with SMTP id q19-20020a170903205300b001943cef0031mr487814pla.49.1675205835275; Tue, 31 Jan 2023 14:57:15 -0800 (PST) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:effb:a74f:225a:28ef]) by smtp.gmail.com with ESMTPSA id t3-20020a170902b20300b001963bc7bdb8sm10229945plr.274.2023.01.31.14.57.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 14:57:13 -0800 (PST) From: Dmitry Torokhov To: Daniel Thompson , Lee Jones , Jingoo Han Subject: [PATCH 2/2] backlight: hx8357: stop using of-specific APIs Date: Tue, 31 Jan 2023 14:57:07 -0800 Message-Id: <20230131225707.3599889-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog In-Reply-To: <20230131225707.3599889-1-dmitry.torokhov@gmail.com> References: <20230131225707.3599889-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Helge Deller , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There is no need for this driver to be OF-specific, so switch it to use device_get_match_data() and stop including various of-related headers. Signed-off-by: Dmitry Torokhov Reviewed-by: Daniel Thompson --- drivers/video/backlight/hx8357.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c index a93e14adb846..2e162a70c1ce 100644 --- a/drivers/video/backlight/hx8357.c +++ b/drivers/video/backlight/hx8357.c @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #include #define HX8357_NUM_IM_PINS 3 @@ -581,11 +581,15 @@ MODULE_DEVICE_TABLE(of, hx8357_dt_ids); static int hx8357_probe(struct spi_device *spi) { + int (*lcd_init_fn)(struct lcd_device *); struct lcd_device *lcdev; struct hx8357_data *lcd; - const struct of_device_id *match; int i, ret; + lcd_init_fn = device_get_match_data(&spi->dev); + if (!lcd_init_fn) + return -EINVAL; + lcd = devm_kzalloc(&spi->dev, sizeof(*lcd), GFP_KERNEL); if (!lcd) return -ENOMEM; @@ -598,10 +602,6 @@ static int hx8357_probe(struct spi_device *spi) lcd->spi = spi; - match = of_match_device(hx8357_dt_ids, &spi->dev); - if (!match || !match->data) - return -EINVAL; - lcd->reset = devm_gpiod_get(&spi->dev, "reset", GPIOD_OUT_LOW); ret = PTR_ERR_OR_ZERO(lcd->reset); if (ret) { @@ -647,7 +647,7 @@ static int hx8357_probe(struct spi_device *spi) hx8357_lcd_reset(lcdev); - ret = ((int (*)(struct lcd_device *))match->data)(lcdev); + ret = lcd_init_fn(lcdev); if (ret) { dev_err(&spi->dev, "Couldn't initialize panel\n"); return ret;