Re: [PATCH 4/9] drivers: ata: ahci_xgene: use devm_platform_ioremap_resource()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

On 03/12/2019 12:19 PM, Enrico Weigelt, metux IT consult wrote:

> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@xxxxxxxxx>
> ---
>  drivers/ata/ahci_xgene.c | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
> index 7e157e1..99c622c 100644
> --- a/drivers/ata/ahci_xgene.c
> +++ b/drivers/ata/ahci_xgene.c
> @@ -752,7 +752,6 @@ static int xgene_ahci_probe(struct platform_device *pdev)
[...]
>  	/* Retrieve the optional IP mux resource */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
> -	if (res) {
> -		void __iomem *csr = devm_ioremap_resource(dev, res);
> -		if (IS_ERR(csr))
> -			return PTR_ERR(csr);
> -
> -		ctx->csr_mux = csr;
> +	ctx->csr_mux = csr = devm_platform_ioremap_resource(pdev, 4);
> +	if (IS_ERR(ctx->csr_mux)) {
> +		dev_info(&pdev->dev, "cant get ip mux resource (optional)");

   Can't.

> +		ctx->csr_mux = NULL;

MBR, Sergei



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux