• Nate Case's avatar
    gpio: pca953x: Get platform_data from OpenFirmware · 1965d303
    Nate Case authored
    On OpenFirmware platforms, it makes the most sense to get platform_data
    from the device tree.  Make an attempt to translate OF node properties
    into platform_data struct before bailing out.
    
    Note that the implementation approach taken differs from other device
    drivers that make use of device tree information.  This is because I2C
    chips are already registered automatically by of_i2c, so we can get by
    with a small translator function in the driver.
    
    [akpm@linux-foundation.org: coding-style fixes]
    [akpm@linux-foundation.org: kfree(NULL) is legal]
    Signed-off-by: default avatarNate Case <ncase@xes-inc.com>
    Cc: David Brownell <david-b@pacbell.net>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    1965d303
pca953x.c 8.2 KB