devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Joseph CHAMG <josright123@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	"joseph_chang@davicom.com.tw" <joseph_chang@davicom.com.tw>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Leon Romanovsky <leon@kernel.org>
Subject: Re: [PATCH v9, 2/2] net: Add dm9051 driver
Date: Tue, 28 Dec 2021 16:34:16 +0100	[thread overview]
Message-ID: <YcsueIU3ynUJrMVt@lunn.ch> (raw)
In-Reply-To: <CAHp75Vfgd=O_SukOrD4Adw4v7JdPBWsVsjwkj2-TiRy=Vk1mPA@mail.gmail.com>

>     +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

      parent reply	other threads:[~2021-12-28 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27 10:02 [PATCH v9, 0/2] ADD DM9051 ETHERNET DRIVER Joseph CHAMG
2021-12-27 10:02 ` [PATCH v9, 1/2] yaml: Add dm9051 SPI network yaml file Joseph CHAMG
2021-12-27 10:02 ` [PATCH v9, 2/2] net: Add dm9051 driver Joseph CHAMG
2021-12-28  1:49   ` Jakub Kicinski
2021-12-28 10:22   ` Andrew Lunn
     [not found]   ` <CAHp75Vfgd=O_SukOrD4Adw4v7JdPBWsVsjwkj2-TiRy=Vk1mPA@mail.gmail.com>
2021-12-28 15:34     ` Andrew Lunn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YcsueIU3ynUJrMVt@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andy.shevchenko@gmail.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=joseph_chang@davicom.com.tw \
    --cc=josright123@gmail.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).