lkml.org 
[lkml]   [2022]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH net-next 06/12] net: dsa: rzn1-a5psw: add Renesas RZ/N1 advanced 5 port switch driver
    On Fri, Apr 15, 2022 at 01:55:03PM +0300, Vladimir Oltean wrote:
    > I meant that for a DSA switch driver is mandatory to call dsa_switch_shutdown()
    > from your ->shutdown method, otherwise subtle things break, sorry for being unclear.
    >
    > Please blindly copy-paste the odd pattern that all other DSA drivers use
    > in ->shutdown and ->remove (with the platform_set_drvdata(dev, NULL) calls),
    > like a normal person :)

    Those platform_set_drvdata(, NULL) calls should be killed - the
    driver model will set the driver data to NULL after ->remove has
    been called - so having drivers also setting the driver data to
    NULL is mere duplication.

    The only case it would matter is if someone is looking up the device
    and then accessing the driver data - and one would hope that's done
    with appropriate locking or other guarantees (e.g. driver can never
    be unbound once the driver data has been set.)

    --
    RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
    FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

    \
     
     \ /
      Last update: 2022-09-17 16:21    [W:3.318 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site