From cac8a63063e33606c4b8419ef34ef7644d7c2fc4 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Tue, 5 Jan 2021 13:02:36 +0100 Subject: vgacon: drop BROKEN_GRAPHICS_PROGRAMS BROKEN_GRAPHICS_PROGRAMS is defined when CONFIG_VGA_CONSOLE=y. And vgacon.c is built exclusively in that case too. So the check for BROKEN_GRAPHICS_PROGRAMS is pointless in vgacon.c as it is always true. So remove the test and BROKEN_GRAPHICS_PROGRAMS completely. This also eliminates the need for vga_font_is_default global as it is only set and never read. Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210105120239.28031-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman --- drivers/video/console/vgacon.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 17876f0179b5..962c12be9774 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -90,7 +90,6 @@ static unsigned int vga_video_num_lines; /* Number of text lines */ static bool vga_can_do_color; /* Do we support colors? */ static unsigned int vga_default_font_height __read_mostly; /* Height of default screen font */ static unsigned char vga_video_type __read_mostly; /* Card type */ -static bool vga_font_is_default = true; static int vga_vesa_blanked; static bool vga_palette_blanked; static bool vga_is_gfx; @@ -878,7 +877,6 @@ static int vgacon_do_font_op(struct vgastate *state, char *arg, int set, beg = 0x0a; } -#ifdef BROKEN_GRAPHICS_PROGRAMS /* * All fonts are loaded in slot 0 (0:1 for 512 ch) */ @@ -886,24 +884,7 @@ static int vgacon_do_font_op(struct vgastate *state, char *arg, int set, if (!arg) return -EINVAL; /* Return to default font not supported */ - vga_font_is_default = false; font_select = ch512 ? 0x04 : 0x00; -#else - /* - * The default font is kept in slot 0 and is never touched. - * A custom font is loaded in slot 2 (256 ch) or 2:3 (512 ch) - */ - - if (set) { - vga_font_is_default = !arg; - if (!arg) - ch512 = false; /* Default font is always 256 */ - font_select = arg ? (ch512 ? 0x0e : 0x0a) : 0x00; - } - - if (!vga_font_is_default) - charmap += 4 * cmapsz; -#endif raw_spin_lock_irq(&vga_lock); /* First, the Sequencer */ -- cgit v1.2.3 From 93cc26fa8f37fbd320f36525bfedd4b3e2b3e2ba Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 18 Jan 2021 14:23:22 +0100 Subject: backlight: lms283gf05: Convert to GPIO descriptors This converts the lms283gf05 backlight driver to use GPIO descriptors and switches the single PXA Palm Z2 device over to defining these. Since the platform data was only used to convey GPIO information we can delete the platform data header. Notice that we define the proper active low semantics in the board file GPIO descriptor table (active low) and assert the reset line by bringing it to "1" (asserted). Cc: Marek Vasut Cc: Haojian Zhuang Cc: Robert Jarzmik Signed-off-by: Linus Walleij Reviewed-by: Daniel Mack Acked-by: Mark Brown Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones --- arch/arm/mach-pxa/z2.c | 12 ++++++---- drivers/video/backlight/lms283gf05.c | 43 ++++++++++++++---------------------- include/linux/spi/lms283gf05.h | 16 -------------- 3 files changed, 25 insertions(+), 46 deletions(-) delete mode 100644 include/linux/spi/lms283gf05.h (limited to 'drivers/video') diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 21fd76bb09cd..89eb5243c85f 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -578,8 +577,13 @@ static struct pxa2xx_spi_chip lms283_chip_info = { .gpio_cs = GPIO88_ZIPITZ2_LCD_CS, }; -static const struct lms283gf05_pdata lms283_pdata = { - .reset_gpio = GPIO19_ZIPITZ2_LCD_RESET, +static struct gpiod_lookup_table lms283_gpio_table = { + .dev_id = "spi2.0", /* SPI bus 2 chip select 0 */ + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO19_ZIPITZ2_LCD_RESET, + "reset", GPIO_ACTIVE_LOW), + { }, + }, }; static struct spi_board_info spi_board_info[] __initdata = { @@ -595,7 +599,6 @@ static struct spi_board_info spi_board_info[] __initdata = { { .modalias = "lms283gf05", .controller_data = &lms283_chip_info, - .platform_data = &lms283_pdata, .max_speed_hz = 400000, .bus_num = 2, .chip_select = 0, @@ -615,6 +618,7 @@ static void __init z2_spi_init(void) { pxa2xx_set_spi_info(1, &pxa_ssp1_master_info); pxa2xx_set_spi_info(2, &pxa_ssp2_master_info); + gpiod_add_lookup_table(&lms283_gpio_table); spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); } #else diff --git a/drivers/video/backlight/lms283gf05.c b/drivers/video/backlight/lms283gf05.c index 0e45685bcc1c..36856962ed83 100644 --- a/drivers/video/backlight/lms283gf05.c +++ b/drivers/video/backlight/lms283gf05.c @@ -9,16 +9,16 @@ #include #include #include -#include +#include #include #include -#include #include struct lms283gf05_state { struct spi_device *spi; struct lcd_device *ld; + struct gpio_desc *reset; }; struct lms283gf05_seq { @@ -90,13 +90,13 @@ static const struct lms283gf05_seq disp_pdwnseq[] = { }; -static void lms283gf05_reset(unsigned long gpio, bool inverted) +static void lms283gf05_reset(struct gpio_desc *gpiod) { - gpio_set_value(gpio, !inverted); + gpiod_set_value(gpiod, 0); /* De-asserted */ mdelay(100); - gpio_set_value(gpio, inverted); + gpiod_set_value(gpiod, 1); /* Asserted */ mdelay(20); - gpio_set_value(gpio, !inverted); + gpiod_set_value(gpiod, 0); /* De-asserted */ mdelay(20); } @@ -125,18 +125,15 @@ static int lms283gf05_power_set(struct lcd_device *ld, int power) { struct lms283gf05_state *st = lcd_get_data(ld); struct spi_device *spi = st->spi; - struct lms283gf05_pdata *pdata = dev_get_platdata(&spi->dev); if (power <= FB_BLANK_NORMAL) { - if (pdata) - lms283gf05_reset(pdata->reset_gpio, - pdata->reset_inverted); + if (st->reset) + lms283gf05_reset(st->reset); lms283gf05_toggle(spi, disp_initseq, ARRAY_SIZE(disp_initseq)); } else { lms283gf05_toggle(spi, disp_pdwnseq, ARRAY_SIZE(disp_pdwnseq)); - if (pdata) - gpio_set_value(pdata->reset_gpio, - pdata->reset_inverted); + if (st->reset) + gpiod_set_value(st->reset, 1); /* Asserted */ } return 0; @@ -150,24 +147,18 @@ static struct lcd_ops lms_ops = { static int lms283gf05_probe(struct spi_device *spi) { struct lms283gf05_state *st; - struct lms283gf05_pdata *pdata = dev_get_platdata(&spi->dev); struct lcd_device *ld; - int ret = 0; - - if (pdata != NULL) { - ret = devm_gpio_request_one(&spi->dev, pdata->reset_gpio, - GPIOF_DIR_OUT | (!pdata->reset_inverted ? - GPIOF_INIT_HIGH : GPIOF_INIT_LOW), - "LMS283GF05 RESET"); - if (ret) - return ret; - } st = devm_kzalloc(&spi->dev, sizeof(struct lms283gf05_state), GFP_KERNEL); if (st == NULL) return -ENOMEM; + st->reset = gpiod_get_optional(&spi->dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(st->reset)) + return PTR_ERR(st->reset); + gpiod_set_consumer_name(st->reset, "LMS283GF05 RESET"); + ld = devm_lcd_device_register(&spi->dev, "lms283gf05", &spi->dev, st, &lms_ops); if (IS_ERR(ld)) @@ -179,8 +170,8 @@ static int lms283gf05_probe(struct spi_device *spi) spi_set_drvdata(spi, st); /* kick in the LCD */ - if (pdata) - lms283gf05_reset(pdata->reset_gpio, pdata->reset_inverted); + if (st->reset) + lms283gf05_reset(st->reset); lms283gf05_toggle(spi, disp_initseq, ARRAY_SIZE(disp_initseq)); return 0; diff --git a/include/linux/spi/lms283gf05.h b/include/linux/spi/lms283gf05.h deleted file mode 100644 index f237b2d062e9..000000000000 --- a/include/linux/spi/lms283gf05.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * lms283gf05.h - Platform glue for Samsung LMS283GF05 LCD - * - * Copyright (C) 2009 Marek Vasut -*/ - -#ifndef _INCLUDE_LINUX_SPI_LMS283GF05_H_ -#define _INCLUDE_LINUX_SPI_LMS283GF05_H_ - -struct lms283gf05_pdata { - unsigned long reset_gpio; - bool reset_inverted; -}; - -#endif /* _INCLUDE_LINUX_SPI_LMS283GF05_H_ */ -- cgit v1.2.3 From 4a98e5ef88f8a7a9fd42e71b018d3070662f8a2a Mon Sep 17 00:00:00 2001 From: Zheng Yongjun Date: Mon, 14 Dec 2020 21:34:58 +0800 Subject: backlight: sky81452-backlight: Convert comma to semicolon Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones --- drivers/video/backlight/sky81452-backlight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c index 8268ac43d54f..c95e0de7f4e7 100644 --- a/drivers/video/backlight/sky81452-backlight.c +++ b/drivers/video/backlight/sky81452-backlight.c @@ -291,7 +291,7 @@ static int sky81452_bl_probe(struct platform_device *pdev) } memset(&props, 0, sizeof(props)); - props.max_brightness = SKY81452_MAX_BRIGHTNESS, + props.max_brightness = SKY81452_MAX_BRIGHTNESS; name = pdata->name ? pdata->name : SKY81452_DEFAULT_NAME; bd = devm_backlight_device_register(dev, name, dev, regmap, &sky81452_bl_ops, &props); -- cgit v1.2.3 From 33d6d2bb7e6bf1ec60d1f4982015db8175c4cba9 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Thu, 14 Jan 2021 17:40:06 +0100 Subject: ARM: 9049/1: locomo: make locomo bus's remove callback return void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver core ignores the return value of struct bus_type::remove because there is only little that can be done. To simplify the quest to make this function return void, let struct locomo_driver::remove return void, too. All users already unconditionally return 0, this commit makes it obvious that returning an error code is a bad idea and ensures future users behave accordingly. Link: https://lore.kernel.org/r/20201126110140.2021758-1-u.kleine-koenig@pengutronix.de Acked-by: Dmitry Torokhov Acked-by: Lee Jones Signed-off-by: Uwe Kleine-König Signed-off-by: Russell King --- arch/arm/common/locomo.c | 5 ++--- arch/arm/include/asm/hardware/locomo.h | 2 +- arch/arm/mach-sa1100/collie.c | 6 ------ drivers/input/keyboard/locomokbd.c | 4 +--- drivers/video/backlight/locomolcd.c | 3 +-- 5 files changed, 5 insertions(+), 15 deletions(-) (limited to 'drivers/video') diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 62f241b09fe3..e45f4e4e06b6 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -838,11 +838,10 @@ static int locomo_bus_remove(struct device *dev) { struct locomo_dev *ldev = LOCOMO_DEV(dev); struct locomo_driver *drv = LOCOMO_DRV(dev->driver); - int ret = 0; if (drv->remove) - ret = drv->remove(ldev); - return ret; + drv->remove(ldev); + return 0; } struct bus_type locomo_bus_type = { diff --git a/arch/arm/include/asm/hardware/locomo.h b/arch/arm/include/asm/hardware/locomo.h index f8712e3c29cf..246a3de25931 100644 --- a/arch/arm/include/asm/hardware/locomo.h +++ b/arch/arm/include/asm/hardware/locomo.h @@ -188,7 +188,7 @@ struct locomo_driver { struct device_driver drv; unsigned int devid; int (*probe)(struct locomo_dev *); - int (*remove)(struct locomo_dev *); + void (*remove)(struct locomo_dev *); }; #define LOCOMO_DRV(_d) container_of((_d), struct locomo_driver, drv) diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index d4e89a02c8c8..14c33ed05318 100644 --- a/arch/arm/mach-sa1100/collie.c +++ b/arch/arm/mach-sa1100/collie.c @@ -224,18 +224,12 @@ static int collie_uart_probe(struct locomo_dev *dev) return 0; } -static int collie_uart_remove(struct locomo_dev *dev) -{ - return 0; -} - static struct locomo_driver collie_uart_driver = { .drv = { .name = "collie_uart", }, .devid = LOCOMO_DEVID_UART, .probe = collie_uart_probe, - .remove = collie_uart_remove, }; static int __init collie_uart_init(void) diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c index daf6a753ca61..dae053596572 100644 --- a/drivers/input/keyboard/locomokbd.c +++ b/drivers/input/keyboard/locomokbd.c @@ -304,7 +304,7 @@ static int locomokbd_probe(struct locomo_dev *dev) return err; } -static int locomokbd_remove(struct locomo_dev *dev) +static void locomokbd_remove(struct locomo_dev *dev) { struct locomokbd *locomokbd = locomo_get_drvdata(dev); @@ -318,8 +318,6 @@ static int locomokbd_remove(struct locomo_dev *dev) release_mem_region((unsigned long) dev->mapbase, dev->length); kfree(locomokbd); - - return 0; } static struct locomo_driver keyboard_driver = { diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c index 297ee2e1ab0b..0468ea82159f 100644 --- a/drivers/video/backlight/locomolcd.c +++ b/drivers/video/backlight/locomolcd.c @@ -208,7 +208,7 @@ static int locomolcd_probe(struct locomo_dev *ldev) return 0; } -static int locomolcd_remove(struct locomo_dev *dev) +static void locomolcd_remove(struct locomo_dev *dev) { unsigned long flags; @@ -220,7 +220,6 @@ static int locomolcd_remove(struct locomo_dev *dev) local_irq_save(flags); locomolcd_dev = NULL; local_irq_restore(flags); - return 0; } static struct locomo_driver poodle_lcd_driver = { -- cgit v1.2.3 From 3fd269e74f2feec973f45ee11d822faeda4fe284 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Tue, 26 Jan 2021 17:58:34 +0100 Subject: amba: Make the remove callback return void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All amba drivers return 0 in their remove callback. Together with the driver core ignoring the return value anyhow, it doesn't make sense to return a value here. Change the remove prototype to return void, which makes it explicit that returning an error value doesn't work as expected. This simplifies changing the core remove callback to return void, too. Reviewed-by: Ulf Hansson Reviewed-by: Arnd Bergmann Acked-by: Alexandre Belloni Acked-by: Dmitry Torokhov Acked-by: Krzysztof Kozlowski # for drivers/memory Acked-by: Mark Brown Acked-by: Linus Walleij Acked-by: Suzuki K Poulose # for hwtracing/coresight Acked-By: Vinod Koul # for dmaengine Acked-by: Guenter Roeck # for watchdog Acked-by: Wolfram Sang # for I2C Acked-by: Takashi Iwai # for sound Acked-by: Vladimir Zapolskiy # for memory/pl172 Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20210126165835.687514-5-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König --- drivers/amba/bus.c | 5 ++--- drivers/char/hw_random/nomadik-rng.c | 3 +-- drivers/dma/pl330.c | 3 +-- drivers/gpu/drm/pl111/pl111_drv.c | 4 +--- drivers/hwtracing/coresight/coresight-catu.c | 3 +-- drivers/hwtracing/coresight/coresight-cpu-debug.c | 4 +--- drivers/hwtracing/coresight/coresight-cti-core.c | 4 +--- drivers/hwtracing/coresight/coresight-etb10.c | 4 +--- drivers/hwtracing/coresight/coresight-etm3x-core.c | 4 +--- drivers/hwtracing/coresight/coresight-etm4x-core.c | 4 +--- drivers/hwtracing/coresight/coresight-funnel.c | 4 ++-- drivers/hwtracing/coresight/coresight-replicator.c | 4 ++-- drivers/hwtracing/coresight/coresight-stm.c | 4 +--- drivers/hwtracing/coresight/coresight-tmc-core.c | 4 +--- drivers/hwtracing/coresight/coresight-tpiu.c | 4 +--- drivers/i2c/busses/i2c-nomadik.c | 4 +--- drivers/input/serio/ambakmi.c | 3 +-- drivers/memory/pl172.c | 4 +--- drivers/memory/pl353-smc.c | 4 +--- drivers/mmc/host/mmci.c | 4 +--- drivers/rtc/rtc-pl030.c | 4 +--- drivers/rtc/rtc-pl031.c | 4 +--- drivers/spi/spi-pl022.c | 5 ++--- drivers/tty/serial/amba-pl010.c | 4 +--- drivers/tty/serial/amba-pl011.c | 3 +-- drivers/vfio/platform/vfio_amba.c | 3 +-- drivers/video/fbdev/amba-clcd.c | 4 +--- drivers/watchdog/sp805_wdt.c | 4 +--- include/linux/amba/bus.h | 2 +- sound/arm/aaci.c | 4 +--- 30 files changed, 34 insertions(+), 80 deletions(-) (limited to 'drivers/video') diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 8c4a42df47c6..48b5d4b4e889 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -300,11 +300,10 @@ static int amba_remove(struct device *dev) { struct amba_device *pcdev = to_amba_device(dev); struct amba_driver *drv = to_amba_driver(dev->driver); - int ret = 0; pm_runtime_get_sync(dev); if (drv->remove) - ret = drv->remove(pcdev); + drv->remove(pcdev); pm_runtime_put_noidle(dev); /* Undo the runtime PM settings in amba_probe() */ @@ -315,7 +314,7 @@ static int amba_remove(struct device *dev) amba_put_disable_pclk(pcdev); dev_pm_domain_detach(dev, true); - return ret; + return 0; } static void amba_shutdown(struct device *dev) diff --git a/drivers/char/hw_random/nomadik-rng.c b/drivers/char/hw_random/nomadik-rng.c index b0ded41eb865..67947a19aa22 100644 --- a/drivers/char/hw_random/nomadik-rng.c +++ b/drivers/char/hw_random/nomadik-rng.c @@ -69,11 +69,10 @@ out_clk: return ret; } -static int nmk_rng_remove(struct amba_device *dev) +static void nmk_rng_remove(struct amba_device *dev) { amba_release_regions(dev); clk_disable(rng_clk); - return 0; } static const struct amba_id nmk_rng_ids[] = { diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index bc0f66af0f11..fd8d2bc3be9f 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -3195,7 +3195,7 @@ probe_err2: return ret; } -static int pl330_remove(struct amba_device *adev) +static void pl330_remove(struct amba_device *adev) { struct pl330_dmac *pl330 = amba_get_drvdata(adev); struct dma_pl330_chan *pch, *_p; @@ -3235,7 +3235,6 @@ static int pl330_remove(struct amba_device *adev) if (pl330->rstc) reset_control_assert(pl330->rstc); - return 0; } static const struct amba_id pl330_ids[] = { diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c index 40e6708fbbe2..1fb5eacefd2d 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -320,7 +320,7 @@ dev_put: return ret; } -static int pl111_amba_remove(struct amba_device *amba_dev) +static void pl111_amba_remove(struct amba_device *amba_dev) { struct device *dev = &amba_dev->dev; struct drm_device *drm = amba_get_drvdata(amba_dev); @@ -331,8 +331,6 @@ static int pl111_amba_remove(struct amba_device *amba_dev) drm_panel_bridge_remove(priv->bridge); drm_dev_put(drm); of_reserved_mem_device_release(dev); - - return 0; } /* diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c index a61313f320bd..8e19e8cdcce5 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -567,12 +567,11 @@ out: return ret; } -static int catu_remove(struct amba_device *adev) +static void catu_remove(struct amba_device *adev) { struct catu_drvdata *drvdata = dev_get_drvdata(&adev->dev); coresight_unregister(drvdata->csdev); - return 0; } static struct amba_id catu_ids[] = { diff --git a/drivers/hwtracing/coresight/coresight-cpu-debug.c b/drivers/hwtracing/coresight/coresight-cpu-debug.c index e1d232411d8d..2dcf13de751f 100644 --- a/drivers/hwtracing/coresight/coresight-cpu-debug.c +++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c @@ -627,7 +627,7 @@ err: return ret; } -static int debug_remove(struct amba_device *adev) +static void debug_remove(struct amba_device *adev) { struct device *dev = &adev->dev; struct debug_drvdata *drvdata = amba_get_drvdata(adev); @@ -642,8 +642,6 @@ static int debug_remove(struct amba_device *adev) if (!--debug_count) debug_func_exit(); - - return 0; } static const struct amba_cs_uci_id uci_id_debug[] = { diff --git a/drivers/hwtracing/coresight/coresight-cti-core.c b/drivers/hwtracing/coresight/coresight-cti-core.c index 61dbc1afd8da..30e48809ba00 100644 --- a/drivers/hwtracing/coresight/coresight-cti-core.c +++ b/drivers/hwtracing/coresight/coresight-cti-core.c @@ -836,7 +836,7 @@ static void cti_device_release(struct device *dev) if (drvdata->csdev_release) drvdata->csdev_release(dev); } -static int cti_remove(struct amba_device *adev) +static void cti_remove(struct amba_device *adev) { struct cti_drvdata *drvdata = dev_get_drvdata(&adev->dev); @@ -845,8 +845,6 @@ static int cti_remove(struct amba_device *adev) mutex_unlock(&ect_mutex); coresight_unregister(drvdata->csdev); - - return 0; } static int cti_probe(struct amba_device *adev, const struct amba_id *id) diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index 0cf6f0b947b6..51c801c05e5c 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -803,7 +803,7 @@ err_misc_register: return ret; } -static int etb_remove(struct amba_device *adev) +static void etb_remove(struct amba_device *adev) { struct etb_drvdata *drvdata = dev_get_drvdata(&adev->dev); @@ -814,8 +814,6 @@ static int etb_remove(struct amba_device *adev) */ misc_deregister(&drvdata->miscdev); coresight_unregister(drvdata->csdev); - - return 0; } #ifdef CONFIG_PM diff --git a/drivers/hwtracing/coresight/coresight-etm3x-core.c b/drivers/hwtracing/coresight/coresight-etm3x-core.c index 5bf5a5a4ce6d..683a69e88efd 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm3x-core.c @@ -909,7 +909,7 @@ static void clear_etmdrvdata(void *info) etmdrvdata[cpu] = NULL; } -static int etm_remove(struct amba_device *adev) +static void etm_remove(struct amba_device *adev) { struct etm_drvdata *drvdata = dev_get_drvdata(&adev->dev); @@ -932,8 +932,6 @@ static int etm_remove(struct amba_device *adev) cpus_read_unlock(); coresight_unregister(drvdata->csdev); - - return 0; } #ifdef CONFIG_PM diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index b20b6ff17cf6..82787cba537d 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -1680,7 +1680,7 @@ static void clear_etmdrvdata(void *info) etmdrvdata[cpu] = NULL; } -static int etm4_remove(struct amba_device *adev) +static void etm4_remove(struct amba_device *adev) { struct etmv4_drvdata *drvdata = dev_get_drvdata(&adev->dev); @@ -1703,8 +1703,6 @@ static int etm4_remove(struct amba_device *adev) cpus_read_unlock(); coresight_unregister(drvdata->csdev); - - return 0; } static const struct amba_id etm4_ids[] = { diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c index 071c723227db..01f8f9285168 100644 --- a/drivers/hwtracing/coresight/coresight-funnel.c +++ b/drivers/hwtracing/coresight/coresight-funnel.c @@ -370,9 +370,9 @@ static int dynamic_funnel_probe(struct amba_device *adev, return funnel_probe(&adev->dev, &adev->res); } -static int dynamic_funnel_remove(struct amba_device *adev) +static void dynamic_funnel_remove(struct amba_device *adev) { - return funnel_remove(&adev->dev); + funnel_remove(&adev->dev); } static const struct amba_id dynamic_funnel_ids[] = { diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c index 7e2a2b7f503f..34fc2f6f3ea9 100644 --- a/drivers/hwtracing/coresight/coresight-replicator.c +++ b/drivers/hwtracing/coresight/coresight-replicator.c @@ -388,9 +388,9 @@ static int dynamic_replicator_probe(struct amba_device *adev, return replicator_probe(&adev->dev, &adev->res); } -static int dynamic_replicator_remove(struct amba_device *adev) +static void dynamic_replicator_remove(struct amba_device *adev) { - return replicator_remove(&adev->dev); + replicator_remove(&adev->dev); } static const struct amba_id dynamic_replicator_ids[] = { diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c index 99791773f682..423df0d30d9c 100644 --- a/drivers/hwtracing/coresight/coresight-stm.c +++ b/drivers/hwtracing/coresight/coresight-stm.c @@ -951,15 +951,13 @@ stm_unregister: return ret; } -static int stm_remove(struct amba_device *adev) +static void stm_remove(struct amba_device *adev) { struct stm_drvdata *drvdata = dev_get_drvdata(&adev->dev); coresight_unregister(drvdata->csdev); stm_unregister_device(&drvdata->stm); - - return 0; } #ifdef CONFIG_PM diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c index 8169dff5a9f6..e29b3914fc0f 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-core.c +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c @@ -559,7 +559,7 @@ out: spin_unlock_irqrestore(&drvdata->spinlock, flags); } -static int tmc_remove(struct amba_device *adev) +static void tmc_remove(struct amba_device *adev) { struct tmc_drvdata *drvdata = dev_get_drvdata(&adev->dev); @@ -570,8 +570,6 @@ static int tmc_remove(struct amba_device *adev) */ misc_deregister(&drvdata->miscdev); coresight_unregister(drvdata->csdev); - - return 0; } static const struct amba_id tmc_ids[] = { diff --git a/drivers/hwtracing/coresight/coresight-tpiu.c b/drivers/hwtracing/coresight/coresight-tpiu.c index d5dfee9ee556..f77c4b0ea4aa 100644 --- a/drivers/hwtracing/coresight/coresight-tpiu.c +++ b/drivers/hwtracing/coresight/coresight-tpiu.c @@ -173,13 +173,11 @@ static int tpiu_probe(struct amba_device *adev, const struct amba_id *id) return PTR_ERR(drvdata->csdev); } -static int tpiu_remove(struct amba_device *adev) +static void tpiu_remove(struct amba_device *adev) { struct tpiu_drvdata *drvdata = dev_get_drvdata(&adev->dev); coresight_unregister(drvdata->csdev); - - return 0; } #ifdef CONFIG_PM diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index d4b1b0865f67..a3363b20f168 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -1055,7 +1055,7 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) return ret; } -static int nmk_i2c_remove(struct amba_device *adev) +static void nmk_i2c_remove(struct amba_device *adev) { struct resource *res = &adev->res; struct nmk_i2c_dev *dev = amba_get_drvdata(adev); @@ -1068,8 +1068,6 @@ static int nmk_i2c_remove(struct amba_device *adev) i2c_clr_bit(dev->virtbase + I2C_CR, I2C_CR_PE); clk_disable_unprepare(dev->clk); release_mem_region(res->start, resource_size(res)); - - return 0; } static struct i2c_vendor_data vendor_stn8815 = { diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index ecdeca147ed7..4408245b61d2 100644 --- a/drivers/input/serio/ambakmi.c +++ b/drivers/input/serio/ambakmi.c @@ -159,7 +159,7 @@ static int amba_kmi_probe(struct amba_device *dev, return ret; } -static int amba_kmi_remove(struct amba_device *dev) +static void amba_kmi_remove(struct amba_device *dev) { struct amba_kmi_port *kmi = amba_get_drvdata(dev); @@ -168,7 +168,6 @@ static int amba_kmi_remove(struct amba_device *dev) iounmap(kmi->base); kfree(kmi); amba_release_regions(dev); - return 0; } static int __maybe_unused amba_kmi_resume(struct device *dev) diff --git a/drivers/memory/pl172.c b/drivers/memory/pl172.c index 575fadbffa30..9eb8cc7de494 100644 --- a/drivers/memory/pl172.c +++ b/drivers/memory/pl172.c @@ -273,14 +273,12 @@ err_clk_enable: return ret; } -static int pl172_remove(struct amba_device *adev) +static void pl172_remove(struct amba_device *adev) { struct pl172_data *pl172 = amba_get_drvdata(adev); clk_disable_unprepare(pl172->clk); amba_release_regions(adev); - - return 0; } static const struct amba_id pl172_ids[] = { diff --git a/drivers/memory/pl353-smc.c b/drivers/memory/pl353-smc.c index 73bd3023202f..3b5b1045edd9 100644 --- a/drivers/memory/pl353-smc.c +++ b/drivers/memory/pl353-smc.c @@ -426,14 +426,12 @@ out_clk_dis_aper: return err; } -static int pl353_smc_remove(struct amba_device *adev) +static void pl353_smc_remove(struct amba_device *adev) { struct pl353_smc_data *pl353_smc = amba_get_drvdata(adev); clk_disable_unprepare(pl353_smc->memclk); clk_disable_unprepare(pl353_smc->aclk); - - return 0; } static const struct amba_id pl353_ids[] = { diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index b5a41a7ce165..32f52d070bbd 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -2195,7 +2195,7 @@ static int mmci_probe(struct amba_device *dev, return ret; } -static int mmci_remove(struct amba_device *dev) +static void mmci_remove(struct amba_device *dev) { struct mmc_host *mmc = amba_get_drvdata(dev); @@ -2223,8 +2223,6 @@ static int mmci_remove(struct amba_device *dev) clk_disable_unprepare(host->clk); mmc_free_host(mmc); } - - return 0; } #ifdef CONFIG_PM diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c index 5a880516f3e8..39038c0754ee 100644 --- a/drivers/rtc/rtc-pl030.c +++ b/drivers/rtc/rtc-pl030.c @@ -137,7 +137,7 @@ static int pl030_probe(struct amba_device *dev, const struct amba_id *id) return ret; } -static int pl030_remove(struct amba_device *dev) +static void pl030_remove(struct amba_device *dev) { struct pl030_rtc *rtc = amba_get_drvdata(dev); @@ -146,8 +146,6 @@ static int pl030_remove(struct amba_device *dev) free_irq(dev->irq[0], rtc); iounmap(rtc->base); amba_release_regions(dev); - - return 0; } static struct amba_id pl030_ids[] = { diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 224bbf096262..620c8dc33647 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c @@ -280,7 +280,7 @@ static int pl031_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) return 0; } -static int pl031_remove(struct amba_device *adev) +static void pl031_remove(struct amba_device *adev) { struct pl031_local *ldata = dev_get_drvdata(&adev->dev); @@ -289,8 +289,6 @@ static int pl031_remove(struct amba_device *adev) if (adev->irq[0]) free_irq(adev->irq[0], ldata); amba_release_regions(adev); - - return 0; } static int pl031_probe(struct amba_device *adev, const struct amba_id *id) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index d1776fea287e..fd74ddfbb686 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2314,13 +2314,13 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id) return status; } -static int +static void pl022_remove(struct amba_device *adev) { struct pl022 *pl022 = amba_get_drvdata(adev); if (!pl022) - return 0; + return; /* * undo pm_runtime_put() in probe. I assume that we're not @@ -2335,7 +2335,6 @@ pl022_remove(struct amba_device *adev) clk_disable_unprepare(pl022->clk); amba_release_regions(adev); tasklet_disable(&pl022->pump_transfers); - return 0; } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c index 3284f34e9dfe..3f96edfe569c 100644 --- a/drivers/tty/serial/amba-pl010.c +++ b/drivers/tty/serial/amba-pl010.c @@ -754,7 +754,7 @@ static int pl010_probe(struct amba_device *dev, const struct amba_id *id) return ret; } -static int pl010_remove(struct amba_device *dev) +static void pl010_remove(struct amba_device *dev) { struct uart_amba_port *uap = amba_get_drvdata(dev); int i; @@ -770,8 +770,6 @@ static int pl010_remove(struct amba_device *dev) if (!busy) uart_unregister_driver(&amba_reg); - - return 0; } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index c255476cce28..4ead0c9048a8 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2679,13 +2679,12 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) return pl011_register_port(uap); } -static int pl011_remove(struct amba_device *dev) +static void pl011_remove(struct amba_device *dev) { struct uart_amba_port *uap = amba_get_drvdata(dev); uart_remove_one_port(&amba_reg, &uap->port); pl011_unregister_port(uap); - return 0; } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/vfio/platform/vfio_amba.c b/drivers/vfio/platform/vfio_amba.c index 7b3ebf1558e1..3626c2150101 100644 --- a/drivers/vfio/platform/vfio_amba.c +++ b/drivers/vfio/platform/vfio_amba.c @@ -71,14 +71,13 @@ static int vfio_amba_probe(struct amba_device *adev, const struct amba_id *id) return ret; } -static int vfio_amba_remove(struct amba_device *adev) +static void vfio_amba_remove(struct amba_device *adev) { struct vfio_platform_device *vdev = vfio_platform_remove_common(&adev->dev); kfree(vdev->name); kfree(vdev); - return 0; } static const struct amba_id pl330_ids[] = { diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c index b7682de412d8..33595cc4778e 100644 --- a/drivers/video/fbdev/amba-clcd.c +++ b/drivers/video/fbdev/amba-clcd.c @@ -925,7 +925,7 @@ static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id) return ret; } -static int clcdfb_remove(struct amba_device *dev) +static void clcdfb_remove(struct amba_device *dev) { struct clcd_fb *fb = amba_get_drvdata(dev); @@ -942,8 +942,6 @@ static int clcdfb_remove(struct amba_device *dev) kfree(fb); amba_release_regions(dev); - - return 0; } static const struct amba_id clcdfb_id_table[] = { diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index 958dc32a708f..58a00e1ab23b 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c @@ -305,14 +305,12 @@ err: return ret; } -static int sp805_wdt_remove(struct amba_device *adev) +static void sp805_wdt_remove(struct amba_device *adev) { struct sp805_wdt *wdt = amba_get_drvdata(adev); watchdog_unregister_device(&wdt->wdd); watchdog_set_drvdata(&wdt->wdd, NULL); - - return 0; } static int __maybe_unused sp805_wdt_suspend(struct device *dev) diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 0bbfd647f5c6..6cc93ab5b809 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -76,7 +76,7 @@ struct amba_device { struct amba_driver { struct device_driver drv; int (*probe)(struct amba_device *, const struct amba_id *); - int (*remove)(struct amba_device *); + void (*remove)(struct amba_device *); void (*shutdown)(struct amba_device *); const struct amba_id *id_table; }; diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index a0996c47e58f..b326a5f5f0d5 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -1055,7 +1055,7 @@ static int aaci_probe(struct amba_device *dev, return ret; } -static int aaci_remove(struct amba_device *dev) +static void aaci_remove(struct amba_device *dev) { struct snd_card *card = amba_get_drvdata(dev); @@ -1066,8 +1066,6 @@ static int aaci_remove(struct amba_device *dev) snd_card_free(card); amba_release_regions(dev); } - - return 0; } static struct amba_id aaci_ids[] = { -- cgit v1.2.3 From 57e0d7b7f8663d0a3a5facc83c445ffc9802ad65 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Tue, 26 Jan 2021 22:32:00 +0100 Subject: backlight: ktd253: Bring up in a known state The KTD253 backlight might already be on when the driver is probed: then we don't really know what the current ratio is and all light intensity settings will be off relative to what it was at boot. To fix this, bring up the backlight OFF then move it to the default backlight from there so we know the state. Signed-off-by: Linus Walleij Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones --- drivers/video/backlight/ktd253-backlight.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/ktd253-backlight.c b/drivers/video/backlight/ktd253-backlight.c index e3fee3f1f582..d7b287cffd5c 100644 --- a/drivers/video/backlight/ktd253-backlight.c +++ b/drivers/video/backlight/ktd253-backlight.c @@ -137,15 +137,7 @@ static int ktd253_backlight_probe(struct platform_device *pdev) brightness = max_brightness; } - if (brightness) - /* This will be the default ratio when the KTD253 is enabled */ - ktd253->ratio = KTD253_MAX_RATIO; - else - ktd253->ratio = 0; - - ktd253->gpiod = devm_gpiod_get(dev, "enable", - brightness ? GPIOD_OUT_HIGH : - GPIOD_OUT_LOW); + ktd253->gpiod = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); if (IS_ERR(ktd253->gpiod)) { ret = PTR_ERR(ktd253->gpiod); if (ret != -EPROBE_DEFER) @@ -153,6 +145,8 @@ static int ktd253_backlight_probe(struct platform_device *pdev) return ret; } gpiod_set_consumer_name(ktd253->gpiod, dev_name(dev)); + /* Bring backlight to a known off state */ + msleep(KTD253_T_OFF_MS); bl = devm_backlight_device_register(dev, dev_name(dev), dev, ktd253, &ktd253_backlight_ops, NULL); -- cgit v1.2.3 From 0b5e0f45af403cb6e9df574e1cb52691611dc0b8 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Tue, 9 Feb 2021 22:13:25 +0100 Subject: backlight/video: Use Platform getter/setter functions Use getter and setter functions, for platform_device structures and a spi_device structure. Signed-off-by: Julia Lawall Acked-by: Daniel Vetter Signed-off-by: Lee Jones --- drivers/video/backlight/qcom-wled.c | 2 +- drivers/video/fbdev/amifb.c | 4 ++-- drivers/video/fbdev/da8xx-fb.c | 4 ++-- drivers/video/fbdev/imxfb.c | 2 +- .../video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c | 6 +++--- drivers/video/fbdev/omap2/omapfb/dss/dpi.c | 4 ++-- drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 4 ++-- drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 2 +- drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 2 +- drivers/video/fbdev/xilinxfb.c | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index 3bc7800eb0a9..091f07e7c145 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -1692,7 +1692,7 @@ static int wled_probe(struct platform_device *pdev) static int wled_remove(struct platform_device *pdev) { - struct wled *wled = dev_get_drvdata(&pdev->dev); + struct wled *wled = platform_get_drvdata(pdev); mutex_destroy(&wled->lock); cancel_delayed_work_sync(&wled->ovp_work); diff --git a/drivers/video/fbdev/amifb.c b/drivers/video/fbdev/amifb.c index 226682550b4b..6e07a97bbd31 100644 --- a/drivers/video/fbdev/amifb.c +++ b/drivers/video/fbdev/amifb.c @@ -3736,7 +3736,7 @@ default_chipset: if (err) goto free_irq; - dev_set_drvdata(&pdev->dev, info); + platform_set_drvdata(pdev, info); err = register_framebuffer(info); if (err) @@ -3764,7 +3764,7 @@ release: static int __exit amifb_remove(struct platform_device *pdev) { - struct fb_info *info = dev_get_drvdata(&pdev->dev); + struct fb_info *info = platform_get_drvdata(pdev); unregister_framebuffer(info); fb_dealloc_cmap(&info->cmap); diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c index e38c0e3f9c61..005ac3c17aa1 100644 --- a/drivers/video/fbdev/da8xx-fb.c +++ b/drivers/video/fbdev/da8xx-fb.c @@ -1066,7 +1066,7 @@ static void lcd_da8xx_cpufreq_deregister(struct da8xx_fb_par *par) static int fb_remove(struct platform_device *dev) { - struct fb_info *info = dev_get_drvdata(&dev->dev); + struct fb_info *info = platform_get_drvdata(dev); struct da8xx_fb_par *par = info->par; int ret; @@ -1482,7 +1482,7 @@ static int fb_probe(struct platform_device *device) da8xx_fb_var.activate = FB_ACTIVATE_FORCE; fb_set_var(da8xx_fb_info, &da8xx_fb_var); - dev_set_drvdata(&device->dev, da8xx_fb_info); + platform_set_drvdata(device, da8xx_fb_info); /* initialize the vsync wait queue */ init_waitqueue_head(&par->vsync_wait); diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index 884b16efa7e8..7f8debd2da06 100644 --- a/drivers/video/fbdev/imxfb.c +++ b/drivers/video/fbdev/imxfb.c @@ -657,7 +657,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf static int imxfb_init_fbinfo(struct platform_device *pdev) { struct imx_fb_platform_data *pdata = dev_get_platdata(&pdev->dev); - struct fb_info *info = dev_get_drvdata(&pdev->dev); + struct fb_info *info = platform_get_drvdata(pdev); struct imxfb_info *fbi = info->par; struct device_node *np; diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c index 0f93a260e432..1bec7a4422e8 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c @@ -239,7 +239,7 @@ static struct omap_dss_driver lb035q02_ops = { static int lb035q02_probe_of(struct spi_device *spi) { struct device_node *node = spi->dev.of_node; - struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev); + struct panel_drv_data *ddata = spi_get_drvdata(spi); struct omap_dss_device *in; struct gpio_desc *gpio; @@ -277,7 +277,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) if (ddata == NULL) return -ENOMEM; - dev_set_drvdata(&spi->dev, ddata); + spi_set_drvdata(spi, ddata); ddata->spi = spi; @@ -318,7 +318,7 @@ err_gpio: static int lb035q02_panel_spi_remove(struct spi_device *spi) { - struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev); + struct panel_drv_data *ddata = spi_get_drvdata(spi); struct omap_dss_device *dssdev = &ddata->dssdev; struct omap_dss_device *in = ddata->in; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c index e2e7fe6f89ee..99ce6e955a46 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c @@ -55,7 +55,7 @@ static struct dpi_data *dpi_get_data_from_dssdev(struct omap_dss_device *dssdev) /* only used in non-DT mode */ static struct dpi_data *dpi_get_data_from_pdev(struct platform_device *pdev) { - return dev_get_drvdata(&pdev->dev); + return platform_get_drvdata(pdev); } static struct dss_pll *dpi_get_pll(enum omap_channel channel) @@ -784,7 +784,7 @@ static int dpi_bind(struct device *dev, struct device *master, void *data) dpi->pdev = pdev; - dev_set_drvdata(&pdev->dev, dpi); + platform_set_drvdata(pdev, dpi); mutex_init(&dpi->lock); diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c index 6f9c25fec994..573ddd37010f 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -399,7 +399,7 @@ module_param(dsi_perf, bool, 0644); static inline struct dsi_data *dsi_get_dsidrv_data(struct platform_device *dsidev) { - return dev_get_drvdata(&dsidev->dev); + return platform_get_drvdata(dsidev); } static inline struct platform_device *dsi_get_dsidev_from_dssdev(struct omap_dss_device *dssdev) @@ -5272,7 +5272,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) return -ENOMEM; dsi->pdev = dsidev; - dev_set_drvdata(&dsidev->dev, dsi); + platform_set_drvdata(dsidev, dsi); spin_lock_init(&dsi->irq_lock); spin_lock_init(&dsi->errors_lock); diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c index 496b43bdad21..800bd108e834 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c @@ -672,7 +672,7 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data) int irq; hdmi.pdev = pdev; - dev_set_drvdata(&pdev->dev, &hdmi); + platform_set_drvdata(pdev, &hdmi); mutex_init(&hdmi.lock); spin_lock_init(&hdmi.audio_playing_lock); diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c index e3d441ade241..2c03608addcd 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c @@ -713,7 +713,7 @@ static int hdmi5_bind(struct device *dev, struct device *master, void *data) int irq; hdmi.pdev = pdev; - dev_set_drvdata(&pdev->dev, &hdmi); + platform_set_drvdata(pdev, &hdmi); mutex_init(&hdmi.lock); spin_lock_init(&hdmi.audio_playing_lock); diff --git a/drivers/video/fbdev/xilinxfb.c b/drivers/video/fbdev/xilinxfb.c index ca4ff658cad0..ffbf900648d9 100644 --- a/drivers/video/fbdev/xilinxfb.c +++ b/drivers/video/fbdev/xilinxfb.c @@ -472,7 +472,7 @@ static int xilinxfb_of_probe(struct platform_device *pdev) if (of_find_property(pdev->dev.of_node, "rotate-display", NULL)) pdata.rotate_screen = 1; - dev_set_drvdata(&pdev->dev, drvdata); + platform_set_drvdata(pdev, drvdata); return xilinxfb_assign(pdev, drvdata, &pdata); } -- cgit v1.2.3 From bfa5782b9caa26f93f42ad79804e1f75a1ce9f18 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Sun, 21 Feb 2021 19:28:53 -0800 Subject: fbdev: atyfb: add stubs for aty_{ld,st}_lcd() Fix build errors when these functions are not defined. ../drivers/video/fbdev/aty/atyfb_base.c: In function 'aty_power_mgmt': ../drivers/video/fbdev/aty/atyfb_base.c:2002:7: error: implicit declaration of function 'aty_ld_lcd'; did you mean 'aty_ld_8'? [-Werror=implicit-function-declaration] 2002 | pm = aty_ld_lcd(POWER_MANAGEMENT, par); ../drivers/video/fbdev/aty/atyfb_base.c:2004:2: error: implicit declaration of function 'aty_st_lcd'; did you mean 'aty_st_8'? [-Werror=implicit-function-declaration] 2004 | aty_st_lcd(POWER_MANAGEMENT, pm, par); Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: Bartlomiej Zolnierkiewicz Cc: Sam Ravnborg Cc: Daniel Vetter Cc: David Airlie Cc: Jani Nikula Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210222032853.21483-1-rdunlap@infradead.org --- drivers/video/fbdev/aty/atyfb_base.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index 83c8e809955a..e946903a86c2 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -175,6 +175,15 @@ u32 aty_ld_lcd(int index, const struct atyfb_par *par) return aty_ld_le32(LCD_DATA, par); } } +#else /* defined(CONFIG_PMAC_BACKLIGHT) || defined(CONFIG_FB_ATY_BACKLIGHT) \ + defined(CONFIG_FB_ATY_GENERIC_LCD) */ +void aty_st_lcd(int index, u32 val, const struct atyfb_par *par) +{ } + +u32 aty_ld_lcd(int index, const struct atyfb_par *par) +{ + return 0; +} #endif /* defined(CONFIG_PMAC_BACKLIGHT) || defined (CONFIG_FB_ATY_GENERIC_LCD) */ #ifdef CONFIG_FB_ATY_GENERIC_LCD -- cgit v1.2.3 From b3880c690beb7f3abf50f333bd8f3ea7040aaf89 Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Wed, 24 Feb 2021 12:06:28 -0800 Subject: video: fbdev: acornfb: remove free_unused_pages() Patch series "mm: simplify free_highmem_page() and free_reserved_page()". Let's simplify and unify free_highmem_page() and free_reserved_page(). This patch (of 2): This function is never used and it is one of the last remaining user of __free_reserved_page(). Let's just drop it. Link: https://lkml.kernel.org/r/20210126182113.19892-1-david@redhat.com Link: https://lkml.kernel.org/r/20210126182113.19892-2-david@redhat.com Fixes: ffd29195ed720188 ("drivers/video/acornfb.c: remove dead code") Signed-off-by: David Hildenbrand Reviewed-by: Oscar Salvador Reviewed-by: Anshuman Khandual Cc: Thomas Gleixner Cc: "Peter Zijlstra (Intel)" Cc: Mike Rapoport Cc: Michal Hocko Cc: Wei Yang Cc: "Gustavo A. R. Silva" Cc: Sam Ravnborg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/fbdev/acornfb.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/acornfb.c b/drivers/video/fbdev/acornfb.c index bcc92aecf666..1b72edc01cfb 100644 --- a/drivers/video/fbdev/acornfb.c +++ b/drivers/video/fbdev/acornfb.c @@ -921,40 +921,6 @@ static int acornfb_detect_monitortype(void) return 4; } -/* - * This enables the unused memory to be freed on older Acorn machines. - * We are freeing memory on behalf of the architecture initialisation - * code here. - */ -static inline void -free_unused_pages(unsigned int virtual_start, unsigned int virtual_end) -{ - int mb_freed = 0; - - /* - * Align addresses - */ - virtual_start = PAGE_ALIGN(virtual_start); - virtual_end = PAGE_ALIGN(virtual_end); - - while (virtual_start < virtual_end) { - struct page *page; - - /* - * Clear page reserved bit, - * set count to 1, and free - * the page. - */ - page = virt_to_page(virtual_start); - __free_reserved_page(page); - - virtual_start += PAGE_SIZE; - mb_freed += PAGE_SIZE / 1024; - } - - printk("acornfb: freed %dK memory\n", mb_freed); -} - static int acornfb_probe(struct platform_device *dev) { unsigned long size; -- cgit v1.2.3 From 39a3898abf4dfb8702929832836b1f785b1c2bc4 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Wed, 24 Feb 2021 13:55:28 -0800 Subject: fbdev: atyfb: always declare aty_{ld,st}_lcd() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previously added stubs for aty_{ld,}st_lcd() make it so that these functions are used regardless of the config options that were guarding them, so remove the #ifdef/#endif lines and make their declarations always visible. This fixes build warnings that were reported by clang: drivers/video/fbdev/aty/atyfb_base.c:180:6: warning: no previous prototype for function 'aty_st_lcd' [-Wmissing-prototypes] void aty_st_lcd(int index, u32 val, const struct atyfb_par *par) ^ drivers/video/fbdev/aty/atyfb_base.c:180:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void aty_st_lcd(int index, u32 val, const struct atyfb_par *par) drivers/video/fbdev/aty/atyfb_base.c:183:5: warning: no previous prototype for function 'aty_ld_lcd' [-Wmissing-prototypes] u32 aty_ld_lcd(int index, const struct atyfb_par *par) ^ drivers/video/fbdev/aty/atyfb_base.c:183:1: note: declare 'static' if the function is not intended to be used outside of this translation unit u32 aty_ld_lcd(int index, const struct atyfb_par *par) They should not be marked as static since they are used in mach64_ct.c. Fixes: bfa5782b9caa ("fbdev: atyfb: add stubs for aty_{ld,st}_lcd()") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Daniel Vetter Cc: Nick Desaulniers Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: Bartlomiej Zolnierkiewicz Cc: Sam Ravnborg Cc: David Airlie Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210224215528.822-1-rdunlap@infradead.org Acked-by: Nick Desaulniers Signed-off-by: Maarten Lankhorst --- drivers/video/fbdev/aty/atyfb.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/aty/atyfb.h b/drivers/video/fbdev/aty/atyfb.h index 551372f9b9aa..465f55beb97f 100644 --- a/drivers/video/fbdev/aty/atyfb.h +++ b/drivers/video/fbdev/aty/atyfb.h @@ -287,11 +287,8 @@ static inline void aty_st_8(int regindex, u8 val, const struct atyfb_par *par) #endif } -#if defined(CONFIG_PMAC_BACKLIGHT) || defined (CONFIG_FB_ATY_GENERIC_LCD) || \ -defined (CONFIG_FB_ATY_BACKLIGHT) extern void aty_st_lcd(int index, u32 val, const struct atyfb_par *par); extern u32 aty_ld_lcd(int index, const struct atyfb_par *par); -#endif /* * DAC operations -- cgit v1.2.3 From b266409310c6b3c523d824616bc3328026b4ee63 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Fri, 26 Feb 2021 09:30:08 -0800 Subject: fbdev: atyfb: use LCD management functions for PPC_PMAC also MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Include PPC_PMAC in the configs that use aty_ld_lcd() and aty_st_lcd() implementations so that the PM code may work correctly for PPC_PMAC. Suggested-by: Ville Syrjälä Signed-off-by: Randy Dunlap Cc: Daniel Vetter Cc: Nick Desaulniers Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: Bartlomiej Zolnierkiewicz Cc: Sam Ravnborg Cc: David Airlie Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210226173008.18236-1-rdunlap@infradead.org Signed-off-by: Maarten Lankhorst --- drivers/video/fbdev/aty/atyfb_base.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index e946903a86c2..1aef3d6ebd88 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -133,7 +133,7 @@ #define PRINTKE(fmt, args...) printk(KERN_ERR "atyfb: " fmt, ## args) #if defined(CONFIG_PMAC_BACKLIGHT) || defined(CONFIG_FB_ATY_GENERIC_LCD) || \ -defined(CONFIG_FB_ATY_BACKLIGHT) +defined(CONFIG_FB_ATY_BACKLIGHT) || defined (CONFIG_PPC_PMAC) static const u32 lt_lcd_regs[] = { CNFG_PANEL_LG, LCD_GEN_CNTL_LG, @@ -175,8 +175,8 @@ u32 aty_ld_lcd(int index, const struct atyfb_par *par) return aty_ld_le32(LCD_DATA, par); } } -#else /* defined(CONFIG_PMAC_BACKLIGHT) || defined(CONFIG_FB_ATY_BACKLIGHT) \ - defined(CONFIG_FB_ATY_GENERIC_LCD) */ +#else /* defined(CONFIG_PMAC_BACKLIGHT) || defined(CONFIG_FB_ATY_BACKLIGHT) || + defined(CONFIG_FB_ATY_GENERIC_LCD) || defined(CONFIG_PPC_PMAC) */ void aty_st_lcd(int index, u32 val, const struct atyfb_par *par) { } @@ -184,7 +184,8 @@ u32 aty_ld_lcd(int index, const struct atyfb_par *par) { return 0; } -#endif /* defined(CONFIG_PMAC_BACKLIGHT) || defined (CONFIG_FB_ATY_GENERIC_LCD) */ +#endif /* defined(CONFIG_PMAC_BACKLIGHT) || defined(CONFIG_FB_ATY_BACKLIGHT) || + defined (CONFIG_FB_ATY_GENERIC_LCD) || defined(CONFIG_PPC_PMAC) */ #ifdef CONFIG_FB_ATY_GENERIC_LCD /* -- cgit v1.2.3