lkml.org 
[lkml]   [2023]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH 3/4] gpio: loongson1: Add DT support
    Wed, Feb 22, 2023 at 07:12:12PM +0800, Keguang Zhang kirjoitti:
    > This patch adds DT support for Loongson-1 GPIO driver,
    > including the following changes.
    > - Add the of_match_table
    > - Parse the ngpios property
    > - Parse the alias id

    Split!

    ...

    > + if (of_property_read_u32(dn, "ngpios", &ngpios)) {
    > + dev_err(dev, "Missing ngpios OF property\n");
    > + return -ENODEV;
    > + }

    Why?! GPIO library has this already.

    ...

    > + id = of_alias_get_id(dn, "gpio");
    > + if (id < 0) {
    > + dev_err(dev, "Couldn't get OF id\n");
    > + return id;
    > + }

    What is this for?

    ...

    > + ls1x_gc->gc.base = pdev->id * BITS_PER_LONG;
    > - ls1x_gc->gc.base = pdev->id * 32;

    No way. This is change makes me thing that initially it's simply wrong. Please,
    just use -1 for the base.

    ...

    > +static const struct of_device_id ls1x_gpio_dt_ids[] = {
    > + { .compatible = "loongson,ls1x-gpio", },

    Inner comma is not needed.

    > + { /* sentinel */ }
    > +};

    You missed MODULE_DEVICE_TABLE().

    --
    With Best Regards,
    Andy Shevchenko


    \
     
     \ /
      Last update: 2023-03-27 00:32    [W:2.610 / U:0.376 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site