lkml.org 
[lkml]   [2021]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v7 2/6] gpio: Add Delta TN48M CPLD GPIO driver
    On Tue, Nov 2, 2021 at 6:57 PM Robert Marko <robert.marko@sartura.hr> wrote:
    >
    > Delta TN48M switch has an onboard Lattice CPLD that is used as a GPIO
    > expander.
    >
    > The CPLD provides 12 pins in total on the TN48M, but on more advanced
    > switch models it provides up to 192 pins, so the driver is extendable
    > to support more switches.

    ...

    > +static int tn48m_gpio_probe(struct platform_device *pdev)
    > +{

    > + const struct tn48m_gpio_config *gpio_config = NULL;
    > + struct gpio_regmap_config config = {0};

    I don't see a point in assigning these variables.

    > + struct regmap *regmap;
    > + u32 base;
    > + int ret;
    > +
    > + if (!pdev->dev.parent)
    > + return -ENODEV;
    > +
    > + gpio_config = device_get_match_data(&pdev->dev);
    > + if (!gpio_config)
    > + return -ENODEV;
    > +
    > + ret = device_property_read_u32(&pdev->dev, "reg", &base);
    > + if (ret)
    > + return ret;
    > +
    > + regmap = dev_get_regmap(pdev->dev.parent, NULL);
    > + if (!regmap)
    > + return -ENODEV;

    > +}

    --
    With Best Regards,
    Andy Shevchenko

    \
     
     \ /
      Last update: 2021-11-02 20:28    [W:2.980 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site