From: "SkyLake Huang (黃啟澤)" <SkyLake.Huang@mediatek.com>
To: "andrew@lunn.ch" <andrew@lunn.ch>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
"horms@kernel.org" <horms@kernel.org>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"edumazet@google.com" <edumazet@google.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"dqfext@gmail.com" <dqfext@gmail.com>,
"Steven Liu (劉人豪)" <steven.liu@mediatek.com>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
"daniel@makrotopia.org" <daniel@makrotopia.org>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH net-next 2/5] net: phy: mediatek: Move LED helper functions into mtk phy lib
Date: Thu, 31 Oct 2024 04:56:59 +0000 [thread overview]
Message-ID: <29352dda1b5c647c30e48fbb31e7781fdab43d9f.camel@mediatek.com> (raw)
In-Reply-To: <7cb014a6-ec64-4482-b85c-44f29760d186@lunn.ch>
On Wed, 2024-10-30 at 22:46 +0100, Andrew Lunn wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> > +void mtk_phy_leds_state_init(struct phy_device *phydev)
> > +{
> > + int i;
> > +
> > + for (i = 0; i < 2; ++i)
> > + phydev->drv->led_hw_control_get(phydev, i, NULL);
> > +}
>
> This does appear to be the same as what it is replacing, but it also
> seems odd.
>
> Why is an init function doing a get? I assume it is to do with
> setting
> priv->led_state? But led_state is not used in setting *rules, which
> is
> what led_hw_control_get() is all about. So maybe in a follow up
> patch,
> move the actual init code out of led_hw_control_get()?
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>
> Andrew
I think I got your point. In a follow up patch, I'll do the following
change:
[Psuedo code]
/* Currently */
mtk_phy_led_hw_ctrl_get() {
get_led_hw_settings(); //on & blink
set/clear &priv->led_state according to led_hw_settings
get *rules according to led_hw_settings
}
/* Change into */
get_led_hw_settings()
mtk_phy_leds_state_init() { /* Actual led_state init code */
get_led_hw_settings(); //on & blink
set/clear &priv->led_state according to led_hw_settings
}
mtk_phy_led_hw_ctrl_get() {
get_led_hw_settings() in register; //on & blink
get *rules according to led_hw_settings
}
BRs,
Sky
next prev parent reply other threads:[~2024-10-31 4:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 10:35 [PATCH net-next 0/5] Re-organize MediaTek ethernet phy drivers and propose mtk-phy-lib Sky Huang
2024-10-30 10:35 ` [PATCH net-next 1/5] net: phy: mediatek: Re-organize MediaTek ethernet phy drivers Sky Huang
2024-10-30 21:35 ` Andrew Lunn
2024-10-31 4:53 ` SkyLake Huang (黃啟澤)
2024-10-31 15:02 ` Andrew Lunn
2024-10-30 10:35 ` [PATCH net-next 2/5] net: phy: mediatek: Move LED helper functions into mtk phy lib Sky Huang
2024-10-30 21:46 ` Andrew Lunn
2024-10-31 4:56 ` SkyLake Huang (黃啟澤) [this message]
2024-10-31 15:03 ` Andrew Lunn
2024-10-30 10:35 ` [PATCH net-next 3/5] net: phy: mediatek: Improve readability of mtk-phy-lib.c's mtk_phy_led_hw_ctrl_set() Sky Huang
2024-10-30 10:35 ` [PATCH net-next 4/5] net: phy: mediatek: Integrate read/write page helper functions Sky Huang
2024-11-01 0:24 ` kernel test robot
2024-11-01 15:14 ` kernel test robot
2024-10-30 10:35 ` [PATCH net-next 5/5] net: phy: mediatek: add MT7530 & MT7531's PHY ID macros Sky Huang
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=29352dda1b5c647c30e48fbb31e7781fdab43d9f.camel@mediatek.com \
--to=skylake.huang@mediatek.com \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=steven.liu@mediatek.com \
/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
all inboxes | Powered by JetHome®