lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140731120011.GS8181@intel.com>
Date:	Thu, 31 Jul 2014 17:30:12 +0530
From:	Vinod Koul <vinod.koul@...el.com>
To:	Vignesh Raman <Vignesh_Raman@...tor.com>
Cc:	dan.j.williams@...el.com, dmaengine@...r.kernel.org,
	linux-kernel@...r.kernel.org, Jiada_Wang@...tor.com
Subject: Re: [PATCH 1/2] dma: imx-sdma: use module_platform_driver for SDMA
 driver

On Wed, Jul 30, 2014 at 06:41:14PM +0530, Vignesh Raman wrote:
> Currently there is no module_exit declared in SDMA driver, so that once
> sdma module is inserted, it's shown with permanent attribute by lsmod,
> and it can't be removed.
> Use module_platform_driver to register/unregister SDMA driver and modify
> SDMA's remove operation, to make SDMA driver possible to be removed.
where is this bit below?

-- 
~Vinod
> 
> Signed-off-by: Jiada Wang <jiada_wang@...tor.com>
> ---
>  drivers/dma/imx-sdma.c |   16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 14867e3..1360b9d 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1633,7 +1633,21 @@ err_irq:
>  
>  static int sdma_remove(struct platform_device *pdev)
>  {
> -	return -EBUSY;
> +	struct sdma_engine *sdma = platform_get_drvdata(pdev);
> +	struct resource *iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	int irq = platform_get_irq(pdev, 0);
> +
> +	dma_async_device_unregister(&sdma->dma_device);
> +	kfree(sdma->script_addrs);
> +	free_irq(irq, sdma);
> +	iounmap(sdma->regs);
> +	release_mem_region(iores->start, resource_size(iores));
> +	kfree(sdma);
> +
> +	platform_set_drvdata(pdev, NULL);
> +
> +	dev_info(&pdev->dev, "Removed...\n");
> +	return 0;
>  }
>  
>  static struct platform_driver sdma_driver = {
> -- 
> 1.7.9.5
> 

-- 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ