lkml.org 
[lkml]   [2021]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9, 2/2] net: Add dm9051 driver
>     +static int dm9051_mdio_read(struct mii_bus *mdiobus, int phy_id, int reg)
> +{
> +       struct board_info *db = mdiobus->priv;
> +       int val, ret;
> +
> +       if (phy_id == DM9051_PHY_ID) {
> +               mutex_lock(&db->addr_lock);
> +               ret = dm9051_phy_read(db, reg, &val);
> +               mutex_unlock(&db->addr_lock);
> +               if (ret)
> +                       return ret;
> +               return val;
> +       }
> +
> +       return 0xffff;
>
>
>
> Hmm.. can we rather use regmap APIs for SPI and MDIO?

Hi Andy

regmap via MDIO is very new, but yes it exists. This driver just needs
SPI which has had regmap support for a long time.

However, i suspect the submitter is trying hard to keep the driver in
a shape they can reuse the core with other OSes. At least that is my
feeling give the way requests for changes are handled. Maybe forcing
the use of regmap is actually a good idea, to break them away from
that bad idea.

Andrew

\
 
 \ /
  Last update: 2021-12-28 16:35    [W:0.059 / U:1.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site