Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751336AbeAPQ7p (ORCPT + 1 other); Tue, 16 Jan 2018 11:59:45 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:37452 "EHLO smtp.domeneshop.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750772AbeAPQ7o (ORCPT ); Tue, 16 Jan 2018 11:59:44 -0500 Subject: Re: [PATCH v16 04/10] drm/tinydrm: Replace tinydrm_of_find_backlight with of_find_backlight To: Meghana Madhyastha , Lee Jones , Daniel Thompson , Jingoo Han , Thierry Reding , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <5644bff495cc2b06f40b61e70f285979b0512821.1516098341.git.meghana.madhyastha@gmail.com> From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= Message-ID: <409d8ee2-4312-c490-90e8-73ef16d2c9f9@tronnes.org> Date: Tue, 16 Jan 2018 17:59:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <5644bff495cc2b06f40b61e70f285979b0512821.1516098341.git.meghana.madhyastha@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Den 16.01.2018 11.34, skrev Meghana Madhyastha: > Remove tinydrm_of_find_backlight from tinydrm-helpers.c. We now have > a generic of_find_backlight defined in backlight.c. Let the callers > of tinydrm_of_find_backlight call of_find_backlight. > > Signed-off-by: Meghana Madhyastha This patch needs rebasing, changes to mi0283qt. You've missed st7735r. I'd appreciate if you could also remove these from tinydrm/Kconfig:     select BACKLIGHT_LCD_SUPPORT     select BACKLIGHT_CLASS_DEVICE It's an ugly hack that we don't need anymore thanks to your work! With that fixed: Reviewed-by: Noralf Trønnes > --- > drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c | 40 -------------------------- > drivers/gpu/drm/tinydrm/mi0283qt.c | 3 +- > include/drm/tinydrm/tinydrm-helpers.h | 2 -- > 3 files changed, 2 insertions(+), 43 deletions(-) > > diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c > index 7326e1758..d1c3ce9ab 100644 > --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c > +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c > @@ -236,46 +236,6 @@ void tinydrm_xrgb8888_to_gray8(u8 *dst, void *vaddr, struct drm_framebuffer *fb, > } > EXPORT_SYMBOL(tinydrm_xrgb8888_to_gray8); > > -/** > - * tinydrm_of_find_backlight - Find backlight device in device-tree > - * @dev: Device > - * > - * This function looks for a DT node pointed to by a property named 'backlight' > - * and uses of_find_backlight_by_node() to get the backlight device. > - * Additionally if the brightness property is zero, it is set to > - * max_brightness. > - * > - * Returns: > - * NULL if there's no backlight property. > - * Error pointer -EPROBE_DEFER if the DT node is found, but no backlight device > - * is found. > - * If the backlight device is found, a pointer to the structure is returned. > - */ > -struct backlight_device *tinydrm_of_find_backlight(struct device *dev) > -{ > - struct backlight_device *backlight; > - struct device_node *np; > - > - np = of_parse_phandle(dev->of_node, "backlight", 0); > - if (!np) > - return NULL; > - > - backlight = of_find_backlight_by_node(np); > - of_node_put(np); > - > - if (!backlight) > - return ERR_PTR(-EPROBE_DEFER); > - > - if (!backlight->props.brightness) { > - backlight->props.brightness = backlight->props.max_brightness; > - DRM_DEBUG_KMS("Backlight brightness set to %d\n", > - backlight->props.brightness); > - } > - > - return backlight; > -} > -EXPORT_SYMBOL(tinydrm_of_find_backlight); > - > #if IS_ENABLED(CONFIG_SPI) > > /** > diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mi0283qt.c > index 674d40764..3f9065fb5 100644 > --- a/drivers/gpu/drm/tinydrm/mi0283qt.c > +++ b/drivers/gpu/drm/tinydrm/mi0283qt.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -190,7 +191,7 @@ static int mi0283qt_probe(struct spi_device *spi) > if (IS_ERR(mipi->regulator)) > return PTR_ERR(mipi->regulator); > > - mipi->backlight = tinydrm_of_find_backlight(dev); > + mipi->backlight = of_find_backlight(dev); > if (IS_ERR(mipi->backlight)) > return PTR_ERR(mipi->backlight); > > diff --git a/include/drm/tinydrm/tinydrm-helpers.h b/include/drm/tinydrm/tinydrm-helpers.h > index f54fae03e..0a4ddbc04 100644 > --- a/include/drm/tinydrm/tinydrm-helpers.h > +++ b/include/drm/tinydrm/tinydrm-helpers.h > @@ -46,8 +46,6 @@ void tinydrm_xrgb8888_to_rgb565(u16 *dst, void *vaddr, > void tinydrm_xrgb8888_to_gray8(u8 *dst, void *vaddr, struct drm_framebuffer *fb, > struct drm_clip_rect *clip); > > -struct backlight_device *tinydrm_of_find_backlight(struct device *dev); > - > size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len); > bool tinydrm_spi_bpw_supported(struct spi_device *spi, u8 bpw); > int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz,