Re: [PATCH] drivers: net: Replace acpi_bus_get_device()

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

 



On Tue, Feb 01, 2022 at 08:07:08PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> 
> Replace acpi_bus_get_device() that is going to be dropped with
> acpi_fetch_acpi_dev().
> 
> No intentional functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> ---
>  drivers/net/ethernet/cavium/thunder/thunder_bgx.c |    4 ++--
>  drivers/net/fjes/fjes_main.c                      |   10 +++-------
>  drivers/net/mdio/mdio-xgene.c                     |    8 +++-----
>  3 files changed, 8 insertions(+), 14 deletions(-)
> 
> Index: linux-pm/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> ===================================================================
> --- linux-pm.orig/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> +++ linux-pm/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> @@ -1407,9 +1407,9 @@ static acpi_status bgx_acpi_register_phy
>  {
>  	struct bgx *bgx = context;
>  	struct device *dev = &bgx->pdev->dev;
> -	struct acpi_device *adev;
> +	struct acpi_device *adev = acpi_fetch_acpi_dev(handle);

Hi Rafael

Since this is part of the networking subsystem, reverse christmas tree
applies. Yes, this driver gets is wrong here, but we should not make
it even worse. Please put this variable first.

> Index: linux-pm/drivers/net/mdio/mdio-xgene.c
> ===================================================================
> --- linux-pm.orig/drivers/net/mdio/mdio-xgene.c
> +++ linux-pm/drivers/net/mdio/mdio-xgene.c
> @@ -280,15 +280,13 @@ static acpi_status acpi_register_phy(acp
>  				     void *context, void **ret)
>  {
>  	struct mii_bus *mdio = context;
> -	struct acpi_device *adev;
> +	struct acpi_device *adev = acpi_fetch_acpi_dev(handle);

Here as well please.

With those changes, you can add my Reviewed-by:

Thanks
     Andrew



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux