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] [day] [month] [year] [list]
Message-ID: <20170907214036.GS11248@lunn.ch>
Date:   Thu, 7 Sep 2017 23:40:36 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Tristram.Ha@...rochip.com
Cc:     muvarov@...il.com, pavel@....cz, nathan.leigh.conrad@...il.com,
        vivien.didelot@...oirfairelinux.com, f.fainelli@...il.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Woojung.Huh@...rochip.com
Subject: Re: [PATCH RFC 5/6] Switch SPI driver calls its own driver switch
 register function

On Thu, Sep 07, 2017 at 09:09:22PM +0000, Tristram.Ha@...rochip.com wrote:
> From: Tristram Ha <Tristram.Ha@...rochip.com>
> 
> SPI driver calls own specific switch register function.
> Shutdown callback function is added to reset switch to default state.
> 
> Signed-off-by: Tristram Ha <Tristram.Ha@...rochip.com>
> ---
> diff --git a/drivers/net/dsa/microchip/ksz_spi.c b/drivers/net/dsa/microchip/ksz_spi.c
> index c519469..d03eb83 100644
> --- a/drivers/net/dsa/microchip/ksz_spi.c
> +++ b/drivers/net/dsa/microchip/ksz_spi.c
> @@ -25,6 +25,8 @@
>  
>  #include "ksz_priv.h"
>  
> +int ksz9477_switch_register(struct ksz_device *dev);

Hi Tristram

This should be placed in a header file somewhere, not here.

> +static void ksz_spi_shutdown(struct spi_device *spi) {
> +	struct ksz_device *dev = spi_get_drvdata(spi);
> +
> +	if (dev)
> +		dev->dev_ops->reset(dev);

shutdown seems like a better name for this op, not reset.

> +}
> +
>  static const struct of_device_id ksz_dt_ids[] = {
>  	{ .compatible = "microchip,ksz9477" },
>  	{},
> @@ -207,6 +217,7 @@ static int ksz_spi_remove(struct spi_device *spi)
>  	},
>  	.probe	= ksz_spi_probe,
>  	.remove	= ksz_spi_remove,
> +	.shutdown = ksz_spi_shutdown,
>  };
>  
>  module_spi_driver(ksz_spi_driver);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ