Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH 2/3] video: xilinxfb: Use devm_kzalloc instead of kzalloc
From: Michal Simek @ 2013-09-12  5:54 UTC (permalink / raw)
  To: linux-kernel, monstr
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev
In-Reply-To: <7016a90750626ba866dddc6f85cfdd71943f6891.1378965270.git.michal.simek@xilinx.com>

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

Simplify driver probe and release function.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
 drivers/video/xilinxfb.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 123cd70..fd9c430 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -368,7 +368,6 @@ err_fbmem:
 		devm_iounmap(dev, drvdata->regs);

 err_region:
-	kfree(drvdata);
 	dev_set_drvdata(dev, NULL);

 	return rc;
@@ -403,7 +402,6 @@ static int xilinxfb_release(struct device *dev)
 		dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
 #endif

-	kfree(drvdata);
 	dev_set_drvdata(dev, NULL);

 	return 0;
@@ -425,7 +423,7 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
 	pdata = xilinx_fb_default_pdata;

 	/* Allocate the driver data region */
-	drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
+	drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
 	if (!drvdata) {
 		dev_err(&pdev->dev, "Couldn't allocate device private record\n");
 		return -ENOMEM;
@@ -453,7 +451,6 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
 		drvdata->dcr_host = dcr_map(op->dev.of_node, start, drvdata->dcr_len);
 		if (!DCR_MAP_OK(drvdata->dcr_host)) {
 			dev_err(&op->dev, "invalid DCR address\n");
-			kfree(drvdata);
 			return -ENODEV;
 		}
 	}
--
1.8.2.3


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related

* [PATCH 3/3] video: xilinxfb: Simplify error path
From: Michal Simek @ 2013-09-12  5:54 UTC (permalink / raw)
  To: linux-kernel, monstr
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev
In-Reply-To: <7016a90750626ba866dddc6f85cfdd71943f6891.1378965270.git.michal.simek@xilinx.com>

[-- Attachment #1: Type: text/plain, Size: 2024 bytes --]

devm_iounmap is called automatically that's why remove it from the code
dev_set_drvdata(dev, NULL) is called by generic code
after device_release or on probe failure.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
 drivers/video/xilinxfb.c | 28 ++++++----------------------
 1 file changed, 6 insertions(+), 22 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index fd9c430..7e3036c 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -260,10 +260,9 @@ static int xilinxfb_assign(struct platform_device *pdev,

 		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 		drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
-		if (IS_ERR(drvdata->regs)) {
-			rc = PTR_ERR(drvdata->regs);
-			goto err_region;
-		}
+		if (IS_ERR(drvdata->regs))
+			return PTR_ERR(drvdata->regs);
+
 		drvdata->regs_phys = res->start;
 	}

@@ -279,11 +278,7 @@ static int xilinxfb_assign(struct platform_device *pdev,

 	if (!drvdata->fb_virt) {
 		dev_err(dev, "Could not allocate frame buffer memory\n");
-		rc = -ENOMEM;
-		if (drvdata->flags & BUS_ACCESS_FLAG)
-			goto err_fbmem;
-		else
-			goto err_region;
+		return -ENOMEM;
 	}

 	/* Clear (turn to black) the framebuffer */
@@ -363,13 +358,6 @@ err_cmap:
 	/* Turn off the display */
 	xilinx_fb_out32(drvdata, REG_CTRL, 0);

-err_fbmem:
-	if (drvdata->flags & BUS_ACCESS_FLAG)
-		devm_iounmap(dev, drvdata->regs);
-
-err_region:
-	dev_set_drvdata(dev, NULL);
-
 	return rc;
 }

@@ -394,16 +382,12 @@ static int xilinxfb_release(struct device *dev)
 	/* Turn off the display */
 	xilinx_fb_out32(drvdata, REG_CTRL, 0);

-	/* Release the resources, as allocated based on interface */
-	if (drvdata->flags & BUS_ACCESS_FLAG)
-		devm_iounmap(dev, drvdata->regs);
 #ifdef CONFIG_PPC_DCR
-	else
+	/* Release the resources, as allocated based on interface */
+	if (!(drvdata->flags & BUS_ACCESS_FLAG))
 		dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
 #endif

-	dev_set_drvdata(dev, NULL);
-
 	return 0;
 }

--
1.8.2.3


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related

* Re: [RFC PATCH] amba: Ensure drvdata is NULL
From: Michal Simek @ 2013-09-12  5:57 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <346db238d6c8c418bddb1e8a166e9818b5074c06.1378305864.git.michal.simek@xilinx.com>

[-- Attachment #1: Type: text/plain, Size: 8371 bytes --]

Hi Russell,

any comment on this one?

Thanks,
Michal


On 09/04/2013 04:44 PM, Michal Simek wrote:
> This patch is inpired by the patch for drvdata
> "device-core: Ensure drvdata = NULL when no driver is bound"
> (sha1: 0998d0631001288a5974afc0b2a5f568bcdecb4d)
> 
> Also it fixes all occurences in drivers.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>  arch/arm/kernel/etm.c           | 6 ------
>  drivers/amba/bus.c              | 2 ++
>  drivers/dma/pl330.c             | 3 ---
>  drivers/input/serio/ambakmi.c   | 2 --
>  drivers/mmc/host/mmci.c         | 2 --
>  drivers/rtc/rtc-pl030.c         | 2 --
>  drivers/rtc/rtc-pl031.c         | 2 --
>  drivers/spi/spi-pl022.c         | 1 -
>  drivers/tty/serial/amba-pl010.c | 3 ---
>  drivers/tty/serial/amba-pl011.c | 3 ---
>  drivers/video/amba-clcd.c       | 2 --
>  drivers/watchdog/sp805_wdt.c    | 1 -
>  12 files changed, 2 insertions(+), 27 deletions(-)
> 
> diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c
> index 8ff0ecd..131a6ab 100644
> --- a/arch/arm/kernel/etm.c
> +++ b/arch/arm/kernel/etm.c
> @@ -385,7 +385,6 @@ out:
>  	return ret;
> 
>  out_unmap:
> -	amba_set_drvdata(dev, NULL);
>  	iounmap(t->etb_regs);
> 
>  out_release:
> @@ -398,8 +397,6 @@ static int etb_remove(struct amba_device *dev)
>  {
>  	struct tracectx *t = amba_get_drvdata(dev);
> 
> -	amba_set_drvdata(dev, NULL);
> -
>  	iounmap(t->etb_regs);
>  	t->etb_regs = NULL;
> 
> @@ -588,7 +585,6 @@ out:
>  	return ret;
> 
>  out_unmap:
> -	amba_set_drvdata(dev, NULL);
>  	iounmap(t->etm_regs);
> 
>  out_release:
> @@ -601,8 +597,6 @@ static int etm_remove(struct amba_device *dev)
>  {
>  	struct tracectx *t = amba_get_drvdata(dev);
> 
> -	amba_set_drvdata(dev, NULL);
> -
>  	iounmap(t->etm_regs);
>  	t->etm_regs = NULL;
> 
> diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
> index c670727..9762090 100644
> --- a/drivers/amba/bus.c
> +++ b/drivers/amba/bus.c
> @@ -373,6 +373,7 @@ static int amba_probe(struct device *dev)
>  		if (ret == 0)
>  			break;
> 
> +		amba_set_drvdata(pcdev, NULL);
>  		pm_runtime_disable(dev);
>  		pm_runtime_set_suspended(dev);
>  		pm_runtime_put_noidle(dev);
> @@ -391,6 +392,7 @@ static int amba_remove(struct device *dev)
> 
>  	pm_runtime_get_sync(dev);
>  	ret = drv->remove(pcdev);
> +	amba_set_drvdata(pcdev, NULL);
>  	pm_runtime_put_noidle(dev);
> 
>  	/* Undo the runtime PM settings in amba_probe() */
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index fa645d8..626f99e 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -3026,8 +3026,6 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
> 
>  	return 0;
>  probe_err3:
> -	amba_set_drvdata(adev, NULL);
> -
>  	/* Idle the DMAC */
>  	list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
>  			chan.device_node) {
> @@ -3061,7 +3059,6 @@ static int pl330_remove(struct amba_device *adev)
>  		of_dma_controller_free(adev->dev.of_node);
> 
>  	dma_async_device_unregister(&pdmac->ddma);
> -	amba_set_drvdata(adev, NULL);
> 
>  	/* Idle the DMAC */
>  	list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
> diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
> index 4e2fd44..b7c206d 100644
> --- a/drivers/input/serio/ambakmi.c
> +++ b/drivers/input/serio/ambakmi.c
> @@ -167,8 +167,6 @@ static int amba_kmi_remove(struct amba_device *dev)
>  {
>  	struct amba_kmi_port *kmi = amba_get_drvdata(dev);
> 
> -	amba_set_drvdata(dev, NULL);
> -
>  	serio_unregister_port(kmi->io);
>  	clk_put(kmi->clk);
>  	iounmap(kmi->base);
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index c3785ed..07e17f1 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1678,8 +1678,6 @@ static int mmci_remove(struct amba_device *dev)
>  {
>  	struct mmc_host *mmc = amba_get_drvdata(dev);
> 
> -	amba_set_drvdata(dev, NULL);
> -
>  	if (mmc) {
>  		struct mmci_host *host = mmc_priv(mmc);
> 
> diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c
> index 22bacdb..a804f75 100644
> --- a/drivers/rtc/rtc-pl030.c
> +++ b/drivers/rtc/rtc-pl030.c
> @@ -153,8 +153,6 @@ static int pl030_remove(struct amba_device *dev)
>  {
>  	struct pl030_rtc *rtc = amba_get_drvdata(dev);
> 
> -	amba_set_drvdata(dev, NULL);
> -
>  	writel(0, rtc->base + RTC_CR);
> 
>  	free_irq(dev->irq[0], rtc);
> diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
> index 0f0609b..c9ca86e 100644
> --- a/drivers/rtc/rtc-pl031.c
> +++ b/drivers/rtc/rtc-pl031.c
> @@ -305,7 +305,6 @@ static int pl031_remove(struct amba_device *adev)
>  {
>  	struct pl031_local *ldata = dev_get_drvdata(&adev->dev);
> 
> -	amba_set_drvdata(adev, NULL);
>  	free_irq(adev->irq[0], ldata);
>  	rtc_device_unregister(ldata->rtc);
>  	iounmap(ldata->base);
> @@ -392,7 +391,6 @@ out_no_irq:
>  	rtc_device_unregister(ldata->rtc);
>  out_no_rtc:
>  	iounmap(ldata->base);
> -	amba_set_drvdata(adev, NULL);
>  out_no_remap:
>  	kfree(ldata);
>  out:
> diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
> index abef061..e12813e 100644
> --- a/drivers/spi/spi-pl022.c
> +++ b/drivers/spi/spi-pl022.c
> @@ -2306,7 +2306,6 @@ pl022_remove(struct amba_device *adev)
>  	amba_release_regions(adev);
>  	tasklet_disable(&pl022->pump_transfers);
>  	spi_unregister_master(pl022->master);
> -	amba_set_drvdata(adev, NULL);
>  	return 0;
>  }
> 
> diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
> index c368405..f630b78 100644
> --- a/drivers/tty/serial/amba-pl010.c
> +++ b/drivers/tty/serial/amba-pl010.c
> @@ -728,7 +728,6 @@ static int pl010_probe(struct amba_device *dev, const struct amba_id *id)
>  	amba_set_drvdata(dev, uap);
>  	ret = uart_add_one_port(&amba_reg, &uap->port);
>  	if (ret) {
> -		amba_set_drvdata(dev, NULL);
>  		amba_ports[i] = NULL;
>  		clk_put(uap->clk);
>   unmap:
> @@ -745,8 +744,6 @@ static int pl010_remove(struct amba_device *dev)
>  	struct uart_amba_port *uap = amba_get_drvdata(dev);
>  	int i;
> 
> -	amba_set_drvdata(dev, NULL);
> -
>  	uart_remove_one_port(&amba_reg, &uap->port);
> 
>  	for (i = 0; i < ARRAY_SIZE(amba_ports); i++)
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index 28b35ad..2a1efe0 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -2143,7 +2143,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
>  	amba_set_drvdata(dev, uap);
>  	ret = uart_add_one_port(&amba_reg, &uap->port);
>  	if (ret) {
> -		amba_set_drvdata(dev, NULL);
>  		amba_ports[i] = NULL;
>  		pl011_dma_remove(uap);
>  	}
> @@ -2156,8 +2155,6 @@ static int pl011_remove(struct amba_device *dev)
>  	struct uart_amba_port *uap = amba_get_drvdata(dev);
>  	int i;
> 
> -	amba_set_drvdata(dev, NULL);
> -
>  	uart_remove_one_port(&amba_reg, &uap->port);
> 
>  	for (i = 0; i < ARRAY_SIZE(amba_ports); i++)
> diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
> index 0a2cce7..0bab6ab 100644
> --- a/drivers/video/amba-clcd.c
> +++ b/drivers/video/amba-clcd.c
> @@ -594,8 +594,6 @@ static int clcdfb_remove(struct amba_device *dev)
>  {
>  	struct clcd_fb *fb = amba_get_drvdata(dev);
> 
> -	amba_set_drvdata(dev, NULL);
> -
>  	clcdfb_disable(fb);
>  	unregister_framebuffer(&fb->fb);
>  	if (fb->fb.cmap.len)
> diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
> index 58df98a..3f786ce 100644
> --- a/drivers/watchdog/sp805_wdt.c
> +++ b/drivers/watchdog/sp805_wdt.c
> @@ -268,7 +268,6 @@ static int sp805_wdt_remove(struct amba_device *adev)
>  	struct sp805_wdt *wdt = amba_get_drvdata(adev);
> 
>  	watchdog_unregister_device(&wdt->wdd);
> -	amba_set_drvdata(adev, NULL);
>  	watchdog_set_drvdata(&wdt->wdd, NULL);
> 
>  	return 0;
> --
> 1.8.2.3
> 


-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply

* [PATCH 00/21] video: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:49 UTC (permalink / raw)
  To: linux-fbdev

Since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound),
the driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

---
 drivers/video/arkfb.c                  |    1 -
 drivers/video/carminefb.c              |    1 -
 drivers/video/cirrusfb.c               |    1 -
 drivers/video/cyber2000fb.c            |    5 -----
 drivers/video/geode/gx1fb_core.c       |    1 -
 drivers/video/geode/gxfb_core.c        |    1 -
 drivers/video/geode/lxfb_core.c        |    1 -
 drivers/video/i740fb.c                 |    1 -
 drivers/video/i810/i810_main.c         |    1 -
 drivers/video/intelfb/intelfbdrv.c     |    2 --
 drivers/video/kyro/fbdev.c             |    1 -
 drivers/video/mb862xx/mb862xxfbdrv.c   |    1 -
 drivers/video/neofb.c                  |    6 ------
 drivers/video/pm2fb.c                  |    1 -
 drivers/video/pm3fb.c                  |    1 -
 drivers/video/s3fb.c                   |    1 -
 drivers/video/savage/savagefb_driver.c |    6 ------
 drivers/video/sis/sis_main.c           |    4 ----
 drivers/video/tdfxfb.c                 |    1 -
 drivers/video/tridentfb.c              |    1 -
 drivers/video/vt8623fb.c               |    1 -
 21 files changed, 39 deletions(-)


^ permalink raw reply

* [PATCH 01/21] video: arkfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:50 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/arkfb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c
index 94a51f1..ff6e304b 100644
--- a/drivers/video/arkfb.c
+++ b/drivers/video/arkfb.c
@@ -1108,7 +1108,6 @@ static void ark_pci_remove(struct pci_dev *dev)
 		pci_release_regions(dev);
 /*		pci_disable_device(dev); */
 
-		pci_set_drvdata(dev, NULL);
 		framebuffer_release(info);
 	}
 }
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 02/21] video: carminefb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:51 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/carminefb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/carminefb.c b/drivers/video/carminefb.c
index 153dd65..b98f709 100644
--- a/drivers/video/carminefb.c
+++ b/drivers/video/carminefb.c
@@ -746,7 +746,6 @@ static void carminefb_remove(struct pci_dev *dev)
 	iounmap(hw->v_regs);
 	release_mem_region(fix.mmio_start, fix.mmio_len);
 
-	pci_set_drvdata(dev, NULL);
 	pci_disable_device(dev);
 	kfree(hw);
 }
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 03/21] video: cirrusfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:51 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/cirrusfb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index 97db3ba..b016746 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -2159,7 +2159,6 @@ static int cirrusfb_pci_register(struct pci_dev *pdev,
 	if (!ret)
 		return 0;
 
-	pci_set_drvdata(pdev, NULL);
 	iounmap(info->screen_base);
 err_release_legacy:
 	if (release_io_ports)
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 04/21] video: cyber2000fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:52 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/cyber2000fb.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
index e78d9f2..42da9c8 100644
--- a/drivers/video/cyber2000fb.c
+++ b/drivers/video/cyber2000fb.c
@@ -1874,11 +1874,6 @@ static void cyberpro_pci_remove(struct pci_dev *dev)
 		iounmap(cfb->region);
 		cyberpro_free_fb_info(cfb);
 
-		/*
-		 * Ensure that the driver data is no longer
-		 * valid.
-		 */
-		pci_set_drvdata(dev, NULL);
 		if (cfb = int_cfb_info)
 			int_cfb_info = NULL;
 
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 05/21] video: lxfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:53 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/geode/lxfb_core.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c
index 4dd7b55..10de31b 100644
--- a/drivers/video/geode/lxfb_core.c
+++ b/drivers/video/geode/lxfb_core.c
@@ -606,7 +606,6 @@ static void lxfb_remove(struct pci_dev *pdev)
 	pci_release_region(pdev, 3);
 
 	fb_dealloc_cmap(&info->cmap);
-	pci_set_drvdata(pdev, NULL);
 	framebuffer_release(info);
 }
 
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 06/21] video: gx1fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:53 UTC (permalink / raw)
  To: linux-fbdev

From fbb1885952efb15a46d03aac050c38fc9179594e Mon Sep 17 00:00:00 2001
From: Jingoo Han <jg1.han@samsung.com>
Date: Thu, 12 Sep 2013 14:42:45 +0900
Subject: [PATCH 06/21] video: gx1fb: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/geode/gx1fb_core.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c
index ebbaada..7551a04 100644
--- a/drivers/video/geode/gx1fb_core.c
+++ b/drivers/video/geode/gx1fb_core.c
@@ -399,7 +399,6 @@ static void gx1fb_remove(struct pci_dev *pdev)
 	release_mem_region(gx1_gx_base() + 0x8300, 0x100);
 
 	fb_dealloc_cmap(&info->cmap);
-	pci_set_drvdata(pdev, NULL);
 
 	framebuffer_release(info);
 }
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 07/21] video: gxfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:54 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/geode/gxfb_core.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c
index 19f0c1ad..a42d74d 100644
--- a/drivers/video/geode/gxfb_core.c
+++ b/drivers/video/geode/gxfb_core.c
@@ -471,7 +471,6 @@ static void gxfb_remove(struct pci_dev *pdev)
 	pci_release_region(pdev, 1);
 
 	fb_dealloc_cmap(&info->cmap);
-	pci_set_drvdata(pdev, NULL);
 
 	framebuffer_release(info);
 }
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 08/21] video: i740fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:54 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/i740fb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/i740fb.c b/drivers/video/i740fb.c
index 6c48388..6501ac1 100644
--- a/drivers/video/i740fb.c
+++ b/drivers/video/i740fb.c
@@ -1194,7 +1194,6 @@ static void i740fb_remove(struct pci_dev *dev)
 		pci_iounmap(dev, info->screen_base);
 		pci_release_regions(dev);
 /*		pci_disable_device(dev); */
-		pci_set_drvdata(dev, NULL);
 		framebuffer_release(info);
 	}
 }
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 09/21] video: i810fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:55 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/i810/i810_main.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index 4ce3438..038192a 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -2129,7 +2129,6 @@ static void __exit i810fb_remove_pci(struct pci_dev *dev)
 
 	unregister_framebuffer(info);  
 	i810fb_release_resource(info, par);
-	pci_set_drvdata(dev, NULL);
 	printk("cleanup_module:  unloaded i810 framebuffer device\n");
 }                                                	
 
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 10/21] video: intelfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:56 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/intelfb/intelfbdrv.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 8209e46..b847d53 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -931,8 +931,6 @@ static void intelfb_pci_unregister(struct pci_dev *pdev)
 		return;
 
 	cleanup(dinfo);
-
-	pci_set_drvdata(pdev, NULL);
 }
 
 /***************************************************************
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 11/21] video: kyrofb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:56 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/kyro/fbdev.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
index 6157f74..c82f040 100644
--- a/drivers/video/kyro/fbdev.c
+++ b/drivers/video/kyro/fbdev.c
@@ -779,7 +779,6 @@ static void kyrofb_remove(struct pci_dev *pdev)
 #endif
 
 	unregister_framebuffer(info);
-	pci_set_drvdata(pdev, NULL);
 	framebuffer_release(info);
 }
 
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 12/21] video: mb862xxfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:57 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/mb862xx/mb862xxfbdrv.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c
index 91c59c9..98d2f8c 100644
--- a/drivers/video/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/mb862xx/mb862xxfbdrv.c
@@ -1157,7 +1157,6 @@ static void mb862xx_pci_remove(struct pci_dev *pdev)
 
 	device_remove_file(&pdev->dev, &dev_attr_dispregs);
 
-	pci_set_drvdata(pdev, NULL);
 	unregister_framebuffer(fbi);
 	fb_dealloc_cmap(&fbi->cmap);
 
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 13/21] video: neofb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:57 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/neofb.c |    6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index 7ef079c..891b0bf 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -2146,12 +2146,6 @@ static void neofb_remove(struct pci_dev *dev)
 		fb_destroy_modedb(info->monspecs.modedb);
 		neo_unmap_mmio(info);
 		neo_free_fb_info(info);
-
-		/*
-		 * Ensure that the driver data is no longer
-		 * valid.
-		 */
-		pci_set_drvdata(dev, NULL);
 	}
 }
 
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 14/21] video: pm2fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:58 UTC (permalink / raw)
  To: linux-fbdev

From 9e2c37ee1d5c2145fac113c483c9e6dd408f10fe Mon Sep 17 00:00:00 2001
From: Jingoo Han <jg1.han@samsung.com>
Date: Thu, 12 Sep 2013 15:11:07 +0900
Subject: [PATCH 14/21] video: pm2fb: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/pm2fb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index 81354ee..45d9a3f 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -1744,7 +1744,6 @@ static void pm2fb_remove(struct pci_dev *pdev)
 	iounmap(par->v_regs);
 	release_mem_region(fix->mmio_start, fix->mmio_len);
 
-	pci_set_drvdata(pdev, NULL);
 	fb_dealloc_cmap(&info->cmap);
 	kfree(info->pixmap.addr);
 	framebuffer_release(info);
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 15/21] video: pm3fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:58 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/pm3fb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c
index 7718faa..9c17474 100644
--- a/drivers/video/pm3fb.c
+++ b/drivers/video/pm3fb.c
@@ -1489,7 +1489,6 @@ static void pm3fb_remove(struct pci_dev *dev)
 		iounmap(par->v_regs);
 		release_mem_region(fix->mmio_start, fix->mmio_len);
 
-		pci_set_drvdata(dev, NULL);
 		kfree(info->pixmap.addr);
 		framebuffer_release(info);
 	}
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 16/21] video: s3fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:59 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/s3fb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index 47ca86c..d158d2c 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -1431,7 +1431,6 @@ static void s3_pci_remove(struct pci_dev *dev)
 		pci_release_regions(dev);
 /*		pci_disable_device(dev); */
 
-		pci_set_drvdata(dev, NULL);
 		framebuffer_release(info);
 	}
 }
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 17/21] video: savagefb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  6:59 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/savage/savagefb_driver.c |    6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 741b239..4dbf45f 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -2362,12 +2362,6 @@ static void savagefb_remove(struct pci_dev *dev)
 		kfree(info->pixmap.addr);
 		pci_release_regions(dev);
 		framebuffer_release(info);
-
-		/*
-		 * Ensure that the driver data is no longer
-		 * valid.
-		 */
-		pci_set_drvdata(dev, NULL);
 	}
 }
 
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 18/21] video: sisfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  7:00 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/sis/sis_main.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index 977e279..793b402 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -5994,7 +5994,6 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if(!ivideo->sisvga_enabled) {
 		if(pci_enable_device(pdev)) {
 			if(ivideo->nbridge) pci_dev_put(ivideo->nbridge);
-			pci_set_drvdata(pdev, NULL);
 			framebuffer_release(sis_fb_info);
 			return -EIO;
 		}
@@ -6211,7 +6210,6 @@ error_3:	vfree(ivideo->bios_abase);
 			pci_dev_put(ivideo->lpcdev);
 		if(ivideo->nbridge)
 			pci_dev_put(ivideo->nbridge);
-		pci_set_drvdata(pdev, NULL);
 		if(!ivideo->sisvga_enabled)
 			pci_disable_device(pdev);
 		framebuffer_release(sis_fb_info);
@@ -6523,8 +6521,6 @@ static void sisfb_remove(struct pci_dev *pdev)
 		mtrr_del(ivideo->mtrr, ivideo->video_base, ivideo->video_size);
 #endif
 
-	pci_set_drvdata(pdev, NULL);
-
 	/* If device was disabled when starting, disable
 	 * it when quitting.
 	 */
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 19/21] video: tdfxfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  7:00 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/tdfxfb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index 64bc28b..f761fe3 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -1646,7 +1646,6 @@ static void tdfxfb_remove(struct pci_dev *pdev)
 			   pci_resource_len(pdev, 1));
 	release_mem_region(pci_resource_start(pdev, 0),
 			   pci_resource_len(pdev, 0));
-	pci_set_drvdata(pdev, NULL);
 	fb_dealloc_cmap(&info->cmap);
 	framebuffer_release(info);
 }
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 20/21] video: tridentfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  7:01 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/tridentfb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
index ab57d38..7ed9a22 100644
--- a/drivers/video/tridentfb.c
+++ b/drivers/video/tridentfb.c
@@ -1553,7 +1553,6 @@ static void trident_pci_remove(struct pci_dev *dev)
 	iounmap(info->screen_base);
 	release_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len);
 	release_mem_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len);
-	pci_set_drvdata(dev, NULL);
 	kfree(info->pixmap.addr);
 	fb_dealloc_cmap(&info->cmap);
 	framebuffer_release(info);
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH 21/21] video: vt8623fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12  7:01 UTC (permalink / raw)
  To: linux-fbdev

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/vt8623fb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c
index e9557fa..6b424dd 100644
--- a/drivers/video/vt8623fb.c
+++ b/drivers/video/vt8623fb.c
@@ -829,7 +829,6 @@ static void vt8623_pci_remove(struct pci_dev *dev)
 		pci_release_regions(dev);
 /*		pci_disable_device(dev); */
 
-		pci_set_drvdata(dev, NULL);
 		framebuffer_release(info);
 	}
 }
-- 
1.7.10.4



^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox