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: 195437 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp371537dyb; Thu, 1 Feb 2024 10:46:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUJUAWL2z9DsxNbiJwzkdqXy77U5qtTP4ipPBDID3lAUPku6r3Dv47tNniB3X/kcnTALo8 X-Received: by 2002:a17:902:d544:b0:1d9:6c3:e24f with SMTP id z4-20020a170902d54400b001d906c3e24fmr8151950plf.38.1706813213101; Thu, 01 Feb 2024 10:46:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706813213; cv=pass; d=google.com; s=arc-20160816; b=BX9bDyvskF6LHDhyIScPc3Rc7qNZxK3ttnv/c0WjzGwXCM49PyMGgfod5F0g0VFs6l ONog0uK1d55k+7c90TsnkAoa6mld0Wz6RDamQnDsDmnuV7OV+QO73zUm07KjP/eQVRbm y6nuh+Tb7a+pbfjKMH+hXQacRK33Y65RC064mfDCyncUrv8lQGItZ2w538CWd5Z3IUyb KaP5ehXI9PFEAZoz43lbmKHWcg67f6TfATsJGhxebp9Aa5kRYy3Wy1DbjZ3/tSb4D4WW JNZvzBhhWYc6qa6IYbp8zijWOSVoOefHp+GuOgEZbGdOSB3YC6sK2KG2d3UyZW8sm++1 8XBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ganfD+o6n19cBXWJY5rE/l0qVu3b4SDiQrJK9UI20gs=; fh=J+LqKAO+Szp6HUgmM9EdjEmz8yximQLpBLF7iSQhqeM=; b=f3Qpgxt6x0VMzdihmO6d6Kjs8UNEzkvJCZH7WMJva3AZUEKGvaaVxyhYKraKmgo6TC 9EDYAY0ghBWAXKoQmmW6nUkRLR8odXEe04rw1Rdz3UQUhgL7QkYn9SRm/6ypqJ27QXpG LKTgjR89KXz1KYzPq2wIjiTx9FjoP5IKB+E83sG7Jx4PJZ/Yntf+dj//3nhK+NBcpGU6 Xu8YWlH5UPS9zRa9ZRI1S62uificWnj0eeE2HYTu0Y+4swWjxa5WlSDs6oGX+z1b2DgI PF5dTf0r1/ZnxvxhUeQMHvBMl+pRVeEa0nIuf0xvtZhalPXLDConQPne92EBYsy0TbtN J86A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MquRwpcH; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-48406-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48406-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCUgPHDiuVv9bDBnz/Pnlqwq4n1iPvtAAvQO0M0/o/Zbr+06czv7xnet4sO12MKv5P7NBJyWCVPGLM/fMlDxk99abuPweg== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j11-20020a170902f24b00b001d8a56d4e92si260086plc.124.2024.02.01.10.46.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 10:46:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48406-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MquRwpcH; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-48406-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48406-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 788E0B2CD5F for ; Thu, 1 Feb 2024 15:29:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB7B1161B48; Thu, 1 Feb 2024 15:26:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MquRwpcH" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94B04779E0; Thu, 1 Feb 2024 15:26:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801206; cv=none; b=edJK5fuD8NbH9K4qf/nSPIjw2t8JAHERnp7sCHs38TJnxrZ3CSVr0ut2QD3Y7lZoG4I8SZ0isK7c8Nwm9LSsvnfL/wUHch++5Ug5aHC31NWwvCnkmqds/hz2WuHHs9asD/YInXU7eNbw4DmVo7lkZzTWajwBORSL44/IkBQM7H8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801206; c=relaxed/simple; bh=P7V8arI0O5w8uxp8JSCtlJ4wD8r1rt7mth6lt0GJXKE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s713L4ZHqvcjUW1SpZFrAAV96EQE3liSjcFJs35y9m4MOQQRgoj9QqG/cVcEBrIV8FcjC4mbfLhAaXZ465oCxSU6v1EuB8uir+s45Smk3OwU41DE6TwnBSBmjFmyLdEoHd219XGLmciIh8Ealshowl2ct6Yvv/d5YlFVkungd2E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MquRwpcH; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706801204; x=1738337204; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=P7V8arI0O5w8uxp8JSCtlJ4wD8r1rt7mth6lt0GJXKE=; b=MquRwpcHV2Y+NXWBkVSMHDNiU3jdsiONq0+h0o85jC4HlE1viEI8lWC/ MFtCbSqGiGWGynBeZAxtGK9ZVOqCB400LOhi7ZwzeUh4n3fQa5Szj0od2 Ei4ZdRFaqxjRTVW8s0UcnjgVYsFLhxgn7C3N2/x0RqZEDs3KeoFNlUUcR iQMMh+b3s3BrpQzeZy4LmJs+XliuUP13GYaDHHnOda7hprYEQt4mIXD0w UizpvNktAseB56hO3hD9sLJTxZRkrds4YSaRq6LTLM0gieslUiKvn8xiZ z5ZxZAMcDTQ/N4tYCfdnLMNyWphCQywAzKrHQpRNljw6Qb7P31e+iDt7a w==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="140708" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="140708" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789723371667773504 X-GMAIL-MSGID: 1789723371667773504 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: 195443 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp384622dyb; Thu, 1 Feb 2024 11:07:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IH35eoFHNaT9bnIdvD8jA2QpsHynM2NBMHnfN7zNjDR/kawPwbfI+Zzxi0TlT1DaV7g7WSh X-Received: by 2002:a05:6e02:5a6:b0:363:812c:b2ed with SMTP id k6-20020a056e0205a600b00363812cb2edmr3398999ils.11.1706814467770; Thu, 01 Feb 2024 11:07:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706814467; cv=pass; d=google.com; s=arc-20160816; b=wczT7rqn/1vOBydFqTCzjG3nS32m2LOHp5wEIWyYXP8AfLym3Ifi8yf64QRBfyOR5b pIi6xdqhR68w+eThFWN0LHKbjl2Ts5q+DKwl5Y22yQtHsv3eSaERFifoeqOLqv5Azv1x YZ/ifA20OFtnwofhTee9RS83agDY9lt/gcf31fq193KwPJAovlFbiOp/mZFJjqX425R4 xQh0JR9+Vx5vCrrtmSBp4oK4zcPS1dU/6sBFWJ8lQ1tguz51waOdUicgMpULJt+sgQCY boKv+L1zF/KGwlMLvWEm3GXaAjzzfmcJtwxCW2tk4FIUTwN/VnPmuQXwUPwTNavEh0LQ W/qg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ahRv8zZWx0oAHrryHscYSXgFn1FMXzYTst8oFm8mn2M=; fh=HPg2+l986KVLrGTrHPpbdEJCoqnYjvobEJ2i0lx0d5o=; b=Rp+8HbE11k5am5Hu5/Uq3+edFvue809HkKolpZKk6sHMYwItthjZehGdSd86/MEGka DHE/YeZ/2ivd4xXhV9Tw2xmxSQnMQ7wrNrYT3grmj3oK7lNPwAelA5dZG8TE3OzB1l39 G0iZM7iQ8lgjihdwkTP8ZjM5jX2CS9aeEaRy6FX9n05m927O6PeiLf3aLUzdl0e7zxoY 38zMygCwheWlrDibleSb2sVOCIk+fZAiVG3LxdO73ShN536VBqkNmIc2mszXbXXafwmb vs5SZo2Dlyz8fOHgFjXsnUkK4n4A1HGYKJMKud08ZQ/DT/mPeEZyItc32HsbH4u1R9K7 dMJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BqKQSyWa; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-48407-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48407-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCUdFFbFuKw/+sndLQi01Qt3AogLXD8v/aQWUbyz27ds2H5fBPPXMRUL2GoduAJsSXWqu/wSEEBWwplH0MKKRPDcgyX5nQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b2-20020a630c02000000b005d8bf0a91besi176590pgl.276.2024.02.01.11.07.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:07:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48407-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BqKQSyWa; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-48407-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48407-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4382F291684 for ; Thu, 1 Feb 2024 15:29:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8DD22161B62; Thu, 1 Feb 2024 15:26:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BqKQSyWa" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BFBB779E7; Thu, 1 Feb 2024 15:26:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801207; cv=none; b=R/eCpKOU75h7cOOU1l1Ll9TJLh6/2dx2VLiDdj9a9wdkUzSm4IoaL28QCxKU5njXu5J4wivwuvb4UOAOla4fj/96puz721DC4gBHlzbJmRAmNUTD1eFuQVEBQE+/7anjiMjmSFFIxgih57k/PddCClaRIV2drKadIF/g817Tz40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801207; c=relaxed/simple; bh=Crj2Xd5+sjM/WF1/AU2C24hHxy1FDdrAbIh7Rfeop1M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pH1rQ+HSHNfaxl3Dd6xLv/YBR8ggJ3sTzf3Zis3p+UE3AynCl0Bs1mzq9XJHsrRrIdHNu1seu6igmzt8bQJNOeIOl+19A8fO51Xe9JiQHn09K8AhckMjeZQ/Lp/VMCkGLpk2FJcWCL64mRHm4cJBy9/vyHpLTqvqW/tNoRT7gLQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BqKQSyWa; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706801206; x=1738337206; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Crj2Xd5+sjM/WF1/AU2C24hHxy1FDdrAbIh7Rfeop1M=; b=BqKQSyWamktiLj9I8CL2YP6m5jb7RZdMsINHVYxz5k0x0JM+IwFkCrX9 rIYqZMvL9IsoY5R3HIw8QRQpl22P0XIbVJIrrcUzpXYN4F3wdTERD66Rd 2zJVk8Ef44rBZhCr7/LrptbF7uM4UmIaXjJy4e/Nwrh1BBPpqqVo+NFCW /kKKAIhAW9oVPEg0ubgAIC7F1U6kmiY4fgLCfxfyUbszaXrMAZbnVGj2V loMwC5LDt/4OOrBTJC/3TJ4CSSWaJU7ClXdWaL/f2SjZjuzOcN9XjRZgH A6YM/PWBBWREytR9a9VorZDtvVTDieUYh+8VqYRGqKXS5dzwAcYN1WHSG g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="140716" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="140716" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789724687196482297 X-GMAIL-MSGID: 1789724687196482297 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: 195470 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp32670dyc; Thu, 1 Feb 2024 13:26:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNKBaJ4N5GYxSALb9WDXIB4O8mtoRBQiHJ1PnXJNeaGOdzTvR37QEK4cYGM51KWvoLKFDq X-Received: by 2002:a17:906:260b:b0:a36:34b6:9ca4 with SMTP id h11-20020a170906260b00b00a3634b69ca4mr2915585ejc.64.1706822789467; Thu, 01 Feb 2024 13:26:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706822789; cv=pass; d=google.com; s=arc-20160816; b=UcEi5joH2pdJxW6d00e4H+QRn3alnuXnaeBMENXOkattP/IJpSuK45T76Dkks9Q8D2 J9MXvzi0XNnJPbjid6uPbvDqT+MTSb8zCNEgnzuM0EuB45VHAlYY9+ecGZTu6XV5BYIc kDZe9O9KDsYDKdmOSalNJrX0t79hjXd8QRc4v5V9M2AIyfWkCNoI6LYeVSV35zJaiCPJ Fj6xPTVofkMdMYxtDx57f3+qwkWptC3n+79Qz0v+m2UAR2j7H1f/Lu57gRC7k2ow0Oie UZ683EYioPnEZ8sbe2zMSgylzsxGhiQtvOMoBP15nJM4X/t7kF5hwZvhvAjvoTZDa+p5 o3lg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=nRlvKL/aTJXkWCmpA1d+PnRbCzO/GZKkQdx0r5aNin4=; fh=fy/NlAJEblmoJjJBH76PDV50C7fOCmDoM8nglOh5d24=; b=Sovyrnedm+chSnfwMSUB43+6qgX43ujUUNjgyARBMSny7AcbS44UB6TrFRNWCfxrJ1 0zSKa5qfX8HxRnWtaDDEMCyLsccbzEPD6v5zWmX0Uo1Zi+5ctu4gR1MOLMIoTpfbVJkz M7l5KdcrlpeTT3Kmbq5Ef6uRRzV+3ZrkuypNIYzWJYs/zfg5FGWWsW7KVNb1cTbIa5Qm NlgJVcV2lYd9rpKT3fBT+nCUPcnV8b40SdrQ0/lN+UJ8gSR4XbBQAW6bTGpTjbUe3X53 Z3jGNq1MVr0neCaZfFAFl6+m66c7Ec+ZlIMrSpsDmE1D32rmTD0WClZXs5GMYd1M1hZr vTGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="WeU8em/U"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-48361-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48361-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCVHqrMm0ClW7P3eCRbsjNTdHuq2FwuT2yLtlXnCKGm6v1vCc5vTkTdYQRlTqP/qTGS/p6DinfiI/qAK+ewXmS3MsdQoEw== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a15-20020a1709066d4f00b00a3673c19b2esi158813ejt.626.2024.02.01.13.26.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 13:26:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48361-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="WeU8em/U"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-48361-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48361-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 60E521F23569 for ; Thu, 1 Feb 2024 15:07:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB723626BC; Thu, 1 Feb 2024 15:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WeU8em/U" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C741E5F49E; Thu, 1 Feb 2024 15:06:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.115 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706800008; cv=none; b=n7PRdFvyhyN4dg5cw4/NCHYq0mZErVsoW+vZRH5DfxpqtyfevctH0PlvWI0vVYLLQfGxIr0Jo+Q9Enzrcj+ce2bw8aqg8yZo8EQqsgVLfhJWHLF1CywWRq3ooYcixHiYe5//6EAeCRgKG9oakYsyY4yYQCmCoTtDmVScmxJSErU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706800008; c=relaxed/simple; bh=/1j+vi+oEj44XXlvg/40fPSK2wRNZe9074gxBAtD/qk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LcaLaXNnBsRVIKRfA7pFwFvmFgit8x5tTvs6RuiHm4laIgaJZFzwR9MCUxv3vIQzVQ7qbJtUbZdn1hRq5Nx2LcXq4FalFumFYzxpcrUqPfjsSsSVBbEa/UHXfRXw2sm/pXzXjEfWm+NrmmwtNmRt+Dl9X6118fFbseWv6hBkYTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=WeU8em/U; arc=none smtp.client-ip=192.55.52.115 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706800006; x=1738336006; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/1j+vi+oEj44XXlvg/40fPSK2wRNZe9074gxBAtD/qk=; b=WeU8em/UrI0EG4w4hlJjI8uxR2C1YOf6+4hjvT6lhbZbbZFOB+NLbxKr WcCfKxr1K3gOjt7l9rH1vqefNpPIPQpEtLOyQw6mt38fKxfk4biMulH8/ lTx00jlnNkWvFl71LIlAFhdRBkNz/PVBBKeNYtL0YT3Th+NNgtX0F4Cr7 GPU7q95uACqBlQtjjNPayznVKHOgSM1jsvdhNqBxwWs5q0OT4cQOVbb+Y vmAcJpgFGgC3GXrljChQKUY54OZtRh+aiT3jCZUOoPV8zWjka1n5NYe0g 6f5NpfAWgrZ0tzEsqLVOhH+0WViUzmP7YPz05LwUgKstl9yWqutLLXIR1 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="403525495" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="403525495" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789733413392204407 X-GMAIL-MSGID: 1789733413392204407 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: 195401 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp308000dyb; Thu, 1 Feb 2024 09:14:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZHF3GWKmJEUG77s6U8FCwA3VxBVD1i7qMgan4U/8kYcfzh04k9j39is1jiFO/V5bbPul/ X-Received: by 2002:a17:902:da8b:b0:1d9:656c:2548 with SMTP id j11-20020a170902da8b00b001d9656c2548mr517500plx.59.1706807665049; Thu, 01 Feb 2024 09:14:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706807665; cv=pass; d=google.com; s=arc-20160816; b=M/YFTP8S2y+xlwDqaiAVBU4tA8rxScKNp4m8Kb/pdwNWCvqqdVGj/SuSUEdNQhlvJV wkQo+DFkv2BqKJGVCOqua/UxPzZmd913Fc+E63WN1u4O1/NMIEk1rv5PXXRWXKasHye8 8AL2CUTt3jcOl202ISgLvpEMbN+/pssPCCrdBp18iuSANvYNXJyxkhaaHrQI/o+4WBJc Ymt37NTATBOVq4A/6ySxI592sdzxmT/Jc7FYfKB/lFoAtFdMLVDK59CYgJg+U4dMQ7/b pGB8Wbfqsy0ZFpvH2B4hmTfOxHTu4p4PVIwOQwgVmbFVeh4N/2g2UA3CCEcNAPz2zKkN 78tg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=No8xqEdV0uEiUbYS4nmz+Tr1swNDEXL3/0wDQjTzK0c=; fh=AB47ukgx3TMxSOeTflOG+Chn+pDm5gltDmtJ6uYGDCs=; b=eBfiwFTOi4a6ZLMCYnw1OgeG8IUzxEQJhFEV4r2+dWly+arQtSSUFy1jE3zqk2eU/3 LJPX9eCucJWCB1+3e9Gh90yegFXEBp5ZW980wne0Ctg/lhI8jjJj8xX3pow6gH8BmAt6 P9Qy3s5FDQtaFzrCFwn9+QrJW7f3tmHrwoQgXKzRMMqwjdo41ER9S862TEUNB1v+gzZ5 vo3iTBNUNw2zoh7v5f8MNbbPNN+xAZjTNgyFaFAOmpp1zmv0AEp1uJrWX9AotDwyeUUZ +U8GOvQFD/4sU0/avWMbMo7spXMWgZAbCVxkJfJefK7FImQiLNbDMhaA2hIACGwlOv3Q EqQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mokQ+Tka; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-48360-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48360-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCUAflTgv1zRgsXi66zP4ZOBXv6u78FFkb2dFmaysFCtFgYMaJYPkak8s1iN+v9HN9+DObgrqOh/5ns6sQnkUgcIlLd3RA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j18-20020a170902da9200b001d949e48d3asi104193plx.607.2024.02.01.09.14.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 09:14:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48360-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mokQ+Tka; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-48360-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48360-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 90CAB284A42 for ; Thu, 1 Feb 2024 15:07:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A382626B5; Thu, 1 Feb 2024 15:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mokQ+Tka" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B0535F494; Thu, 1 Feb 2024 15:06:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.115 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706800007; cv=none; b=LJfw5jcw449tlc219mVFIR5hLgKi7qk3BJMyNkBzZfhW3eXne+ZGjihEN8sKddufte56OS0QCybm++Gko6GS6TLjduPgUD/QXMGEpiMHPDknr9COS/eJ9heNrRRrGMacreHFuBn/nN6T8ldVl6v2uU+dFae1QPmwM4ZPzUD1EuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706800007; c=relaxed/simple; bh=owxSNrvDkg3gD50cec2iQ+m3WCWKt4TbmkW4j3XR5ow=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pXz0OqZLyVp0kQNkUXYuwm6IPQkR5vdICjv6rGMNIy1Bxlhle4vj2qI4UgZy3ptT22J1Xo+bde9iYWZC4uVp1s8Tqs1Xl/YM+B5bxrzLyyk0io7eF2zxDud4aRa6s2ZqAKV1RaDpNw0afahTbnZOCvYMtYLXz/vJ8Gji6hg188g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=mokQ+Tka; arc=none smtp.client-ip=192.55.52.115 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706800006; x=1738336006; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=owxSNrvDkg3gD50cec2iQ+m3WCWKt4TbmkW4j3XR5ow=; b=mokQ+Tkaa4s4+O29luDCr7zIUxriHwR6W5OuZ8ygz4o/ertOjqB7PkQk j4we5K7nJv5E+OjqEz0nwMVosVbhKC8aevHfLhRFLSTWMZHXtlwcdO0IQ zjf3MBXw5WNrVdzrOSpe+/ParfdKbBDMp5NsuqLGXMnJKKAi5FTVFH1OF 53Al2VrVUo0olhAJZN2lQzHKsVCtmsikaVC7qIhC0DqpwgMbU1U6o5EHd PvBQvsKrqwKeDwVJBGSYaoolvCLw6nWplLfbrX3yp347obY5EdQ4VG0x/ sEbioocg885EhniutOaIM+6LtTUeoTYsu4X5tjikQZ5u9mJgB7A3xxbkF w==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="403525484" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="403525484" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789717554028909180 X-GMAIL-MSGID: 1789717554028909180 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; }