[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <c1b768e0-c5d6-a0bf-f756-6f7bff159bea@linux.vnet.ibm.com>
Date: Tue, 13 Mar 2018 10:38:27 +0100
From: Frederic Barrat <fbarrat@...ux.vnet.ibm.com>
To: Arvind Yadav <arvind.yadav.cs@...il.com>, sudeep.dutt@...el.com,
ashutosh.dixit@...el.com, arnd@...db.de,
gregkh@...uxfoundation.org, andrew.donnellan@....ibm.com
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH 2/2] misc: ocxl: use put_device() instead of
device_unregister()
Le 12/03/2018 à 12:36, Arvind Yadav a écrit :
> if device_register() returned an error! Always use put_device()
> to give up the reference initialized.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
> ---
OK, device_unregister() calls put_device() but also other actions that
we can skip in this case.
Acked-by: Frederic Barrat <fbarrat@...ux.vnet.ibm.com>
> drivers/misc/ocxl/pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/ocxl/pci.c b/drivers/misc/ocxl/pci.c
> index 0051d9e..21f4254 100644
> --- a/drivers/misc/ocxl/pci.c
> +++ b/drivers/misc/ocxl/pci.c
> @@ -519,7 +519,7 @@ static struct ocxl_fn *init_function(struct pci_dev *dev)
> rc = device_register(&fn->dev);
> if (rc) {
> deconfigure_function(fn);
> - device_unregister(&fn->dev);
> + put_device(&fn->dev);
> return ERR_PTR(rc);
> }
> return fn;
>
Powered by blists - more mailing lists