From patchwork Thu Feb 1 14:47:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13541264 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 02934C48291 for ; Thu, 1 Feb 2024 15:33:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BAB8110F20E; Thu, 1 Feb 2024 15:33:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="JLSupS6M"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3221310F2F5 for ; Thu, 1 Feb 2024 15:33:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706801630; x=1738337630; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=P7V8arI0O5w8uxp8JSCtlJ4wD8r1rt7mth6lt0GJXKE=; b=JLSupS6MM1LmAiFN6H1/mFG0js3ymQ2vDPqlkJGm9BRtZWs/EqvsDIx7 qXnLcXxKVNkeMANZfLDErV59j64E06qSy6NCHAdgaYePKN5vzrgpxk0I9 S4S1o5eVnAX/BGYfShGdsoKjCNFr+EXndiy/l38RSJ1B3tCPlnUZbUWQ/ KTSlNZBLDzVPiGazRh7ktzVdues+DYDx4Vcoos48t04P1ae5emjsn+UPE n/N4Gkhmj9SUofjxg9aSQ9uqGROuP5Zna5vUsBFWDlpUqfY2dGsP8xF8B NVJf7rMjc/1cRZdWuYJygyqPJ3NT2kcDSRlXLyaGm4scyBLqvTUHPbzoY g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="140707" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="140707" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2024 07:26:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="908275360" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="908275360" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 01 Feb 2024 07:26:41 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id ED67B9FD; Thu, 1 Feb 2024 16:49:52 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Daniel Thompson , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lee Jones , Jingoo Han , Helge Deller , Javier Martinez Canillas Subject: [PATCH v2 1/4] backlight: hx8357: Make use of device properties Date: Thu, 1 Feb 2024 16:47:42 +0200 Message-ID: <20240201144951.294215-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240201144951.294215-1-andriy.shevchenko@linux.intel.com> References: <20240201144951.294215-1-andriy.shevchenko@linux.intel.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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Include mod_devicetable.h explicitly to replace the dropped of.h which included mod_devicetable.h indirectly. Reviewed-by: Javier Martinez Canillas Signed-off-by: Andy Shevchenko Reviewed-by: Daniel Thompson --- drivers/video/backlight/hx8357.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c index bf18337ff0c2..ac65609e5d84 100644 --- a/drivers/video/backlight/hx8357.c +++ b/drivers/video/backlight/hx8357.c @@ -8,9 +8,9 @@ #include #include #include +#include #include -#include -#include +#include #include #define HX8357_NUM_IM_PINS 3 @@ -564,6 +564,8 @@ static struct lcd_ops hx8357_ops = { .get_power = hx8357_get_power, }; +typedef int (*hx8357_init_fn)(struct lcd_device *); + static const struct of_device_id hx8357_dt_ids[] = { { .compatible = "himax,hx8357", @@ -582,7 +584,7 @@ static int hx8357_probe(struct spi_device *spi) struct device *dev = &spi->dev; struct lcd_device *lcdev; struct hx8357_data *lcd; - const struct of_device_id *match; + hx8357_init_fn init_fn; int i, ret; lcd = devm_kzalloc(&spi->dev, sizeof(*lcd), GFP_KERNEL); @@ -597,8 +599,8 @@ static int hx8357_probe(struct spi_device *spi) lcd->spi = spi; - match = of_match_device(hx8357_dt_ids, &spi->dev); - if (!match || !match->data) + init_fn = device_get_match_data(dev); + if (!init_fn) return -EINVAL; lcd->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); @@ -627,7 +629,7 @@ static int hx8357_probe(struct spi_device *spi) hx8357_lcd_reset(lcdev); - ret = ((int (*)(struct lcd_device *))match->data)(lcdev); + ret = init_fn(lcdev); if (ret) { dev_err(&spi->dev, "Couldn't initialize panel\n"); return ret; From patchwork Thu Feb 1 14:47:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13541263 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 27769C4828F for ; Thu, 1 Feb 2024 15:33:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7FA6610F273; Thu, 1 Feb 2024 15:33:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="jxBWNOgo"; dkim-atps=neutral X-Greylist: delayed 426 seconds by postgrey-1.36 at gabe; Thu, 01 Feb 2024 15:33:50 UTC Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1015210F273 for ; Thu, 1 Feb 2024 15:33:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706801630; x=1738337630; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Crj2Xd5+sjM/WF1/AU2C24hHxy1FDdrAbIh7Rfeop1M=; b=jxBWNOgoHTiofy9QFKgn9cn1MHCWiGSqDo24vUmDC6f6/L2vj5YdNRJT A673A2Sp0SW/KTyIkV1PHDAEgtdq8qrSbsCuSLDmdnjQJ27c3qfWlOA7c ka5ZifmLCVOclsRTi/8ViSbcjYxXIcv1Dn1T7u3iaWyuUlsRhDQAZA4Pw qVT5FUtUnFt3kw4l84j4887g6brlBELM8DbFEj4IYTUPYYiA+bcF4zvZW jacmbErPoIdvX4doK/JR3rc0piij/mEL1UQGIfb3TjjtvjBIxjVqR0sA/ Y/Rt3tfkxdz576hqIv7kA9DiCb3A1KGhE/sesk3tV7I65UIQLFE6zT61r g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="140714" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="140714" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2024 07:26:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="908275361" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="908275361" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 01 Feb 2024 07:26:41 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id F2F7CA8A; Thu, 1 Feb 2024 16:49:52 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Daniel Thompson , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lee Jones , Jingoo Han , Helge Deller , Javier Martinez Canillas Subject: [PATCH v2 2/4] backlight: hx8357: Move OF table closer to its consumer Date: Thu, 1 Feb 2024 16:47:43 +0200 Message-ID: <20240201144951.294215-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240201144951.294215-1-andriy.shevchenko@linux.intel.com> References: <20240201144951.294215-1-andriy.shevchenko@linux.intel.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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move OF table near to the user. While at it, drop comma at terminator entry. Reviewed-by: Daniel Thompson Reviewed-by: Javier Martinez Canillas Signed-off-by: Andy Shevchenko --- drivers/video/backlight/hx8357.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c index ac65609e5d84..81d0984e9d8b 100644 --- a/drivers/video/backlight/hx8357.c +++ b/drivers/video/backlight/hx8357.c @@ -566,19 +566,6 @@ static struct lcd_ops hx8357_ops = { typedef int (*hx8357_init_fn)(struct lcd_device *); -static const struct of_device_id hx8357_dt_ids[] = { - { - .compatible = "himax,hx8357", - .data = hx8357_lcd_init, - }, - { - .compatible = "himax,hx8369", - .data = hx8369_lcd_init, - }, - {}, -}; -MODULE_DEVICE_TABLE(of, hx8357_dt_ids); - static int hx8357_probe(struct spi_device *spi) { struct device *dev = &spi->dev; @@ -640,6 +627,19 @@ static int hx8357_probe(struct spi_device *spi) return 0; } +static const struct of_device_id hx8357_dt_ids[] = { + { + .compatible = "himax,hx8357", + .data = hx8357_lcd_init, + }, + { + .compatible = "himax,hx8369", + .data = hx8369_lcd_init, + }, + {} +}; +MODULE_DEVICE_TABLE(of, hx8357_dt_ids); + static struct spi_driver hx8357_driver = { .probe = hx8357_probe, .driver = { From patchwork Thu Feb 1 14:47:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13541205 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 D3E11C4828D for ; Thu, 1 Feb 2024 15:06:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5931510EEFC; Thu, 1 Feb 2024 15:06:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="I8p3fpwc"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 351B010EEFB for ; Thu, 1 Feb 2024 15:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706800008; x=1738336008; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/1j+vi+oEj44XXlvg/40fPSK2wRNZe9074gxBAtD/qk=; b=I8p3fpwcGb4nvXfIcautA2rhVHK34rc4PWqp6DQGmGYiBS2/05vVHxdP OYZdukDY3B9dJ3oJwyNbI/1m7AiqHPYjLw0mKwekNj3T/F7VW6eG5gZnW KRsKJ2LorUlwUcdtXeoULkcy92T/kVzgKrE9eenPUUPg5JcYAzjOxvIcO 784sF45Ll2asmhTV65CLE5VemTdVT9joI1EjBQ7/QZ9G599Zw2cXohuHx rrqYrelumSTxev7Ytjz+Gf3RvUQQXVisml4kF0DwABScvUZMnU+9MT91F jQjptN/7Ps4CerD/xqq2844ngEoxfmGElqFaz2yHF9tcGVca/Q6e/woj/ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="403525492" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="403525492" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2024 07:06:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="859168147" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="859168147" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 01 Feb 2024 07:06:41 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0E35EB84; Thu, 1 Feb 2024 16:49:53 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Daniel Thompson , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lee Jones , Jingoo Han , Helge Deller , Javier Martinez Canillas Subject: [PATCH v2 3/4] backlight: hx8357: Make use of dev_err_probe() Date: Thu, 1 Feb 2024 16:47:44 +0200 Message-ID: <20240201144951.294215-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240201144951.294215-1-andriy.shevchenko@linux.intel.com> References: <20240201144951.294215-1-andriy.shevchenko@linux.intel.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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Simplify the error handling in probe function by switching from dev_err() to dev_err_probe(). Reviewed-by: Daniel Thompson Reviewed-by: Javier Martinez Canillas Signed-off-by: Andy Shevchenko --- drivers/video/backlight/hx8357.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c index 81d0984e9d8b..70a62755805a 100644 --- a/drivers/video/backlight/hx8357.c +++ b/drivers/video/backlight/hx8357.c @@ -579,10 +579,8 @@ static int hx8357_probe(struct spi_device *spi) return -ENOMEM; ret = spi_setup(spi); - if (ret < 0) { - dev_err(&spi->dev, "SPI setup failed.\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(dev, ret, "SPI setup failed.\n"); lcd->spi = spi; @@ -617,10 +615,8 @@ static int hx8357_probe(struct spi_device *spi) hx8357_lcd_reset(lcdev); ret = init_fn(lcdev); - if (ret) { - dev_err(&spi->dev, "Couldn't initialize panel\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Couldn't initialize panel\n"); dev_info(&spi->dev, "Panel probed\n"); From patchwork Thu Feb 1 14:47:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13541204 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 254EAC4828F for ; Thu, 1 Feb 2024 15:06:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 05E2D10EEF9; Thu, 1 Feb 2024 15:06:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="kgws7JnP"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1642910EEFC for ; Thu, 1 Feb 2024 15:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706800008; x=1738336008; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=owxSNrvDkg3gD50cec2iQ+m3WCWKt4TbmkW4j3XR5ow=; b=kgws7JnPe/RF+UQBRMtWjf4HKrCKq1Rl5r2IuGzgeYc20dcTQtvNF0N5 N5NoKdfofY1/ifcFrCTbqX5pQAOcic8NetLqkhBJZEXGzpFHrbHqgHPv5 qpUPrRUppLpQB4O4OrdTvcStcJj8oYCAAQV87pkSzF9yhkdP9lLNNYMr9 hQ04Cm0MgzUS014mf9QgSazVIzYszz+qjFfuf8Lev8vGA+WDVhp01Aq0/ K3TawIWYc58WCyAgDK9H5WZb4RCuplVVfVcpJtCS9FLC1vptyQ3cymaDE +vHEYPFNz2Dx+hBHMqqCcmv54w178Er7v8LrG9puTvTataOQOlvtnyw83 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="403525486" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="403525486" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2024 07:06:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="859168148" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="859168148" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 01 Feb 2024 07:06:41 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 19175BA3; Thu, 1 Feb 2024 16:49:53 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Daniel Thompson , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lee Jones , Jingoo Han , Helge Deller , Javier Martinez Canillas Subject: [PATCH v2 4/4] backlight: hx8357: Utilise temporary variable for struct device Date: Thu, 1 Feb 2024 16:47:45 +0200 Message-ID: <20240201144951.294215-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240201144951.294215-1-andriy.shevchenko@linux.intel.com> References: <20240201144951.294215-1-andriy.shevchenko@linux.intel.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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We have a temporary variable to keep pointer to struct device. Utilise it inside the ->probe() implementation. Reviewed-by: Daniel Thompson Reviewed-by: Javier Martinez Canillas Signed-off-by: Andy Shevchenko --- drivers/video/backlight/hx8357.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c index 70a62755805a..339d9128fbde 100644 --- a/drivers/video/backlight/hx8357.c +++ b/drivers/video/backlight/hx8357.c @@ -574,7 +574,7 @@ static int hx8357_probe(struct spi_device *spi) hx8357_init_fn init_fn; int i, ret; - lcd = devm_kzalloc(&spi->dev, sizeof(*lcd), GFP_KERNEL); + lcd = devm_kzalloc(dev, sizeof(*lcd), GFP_KERNEL); if (!lcd) return -ENOMEM; @@ -604,8 +604,7 @@ static int hx8357_probe(struct spi_device *spi) gpiod_set_consumer_name(lcd->im_pins->desc[i], "im_pins"); } - lcdev = devm_lcd_device_register(&spi->dev, "mxsfb", &spi->dev, lcd, - &hx8357_ops); + lcdev = devm_lcd_device_register(dev, "mxsfb", dev, lcd, &hx8357_ops); if (IS_ERR(lcdev)) { ret = PTR_ERR(lcdev); return ret; @@ -618,7 +617,7 @@ static int hx8357_probe(struct spi_device *spi) if (ret) return dev_err_probe(dev, ret, "Couldn't initialize panel\n"); - dev_info(&spi->dev, "Panel probed\n"); + dev_info(dev, "Panel probed\n"); return 0; }