mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Francois Romieu <romieu@fr.zoreil.com>
To: Jongsung Kim <neidhard.kim@lge.com>
Cc: davem@davemloft.net, peppe.cavallaro@st.com,
	chohnstaedt@innominate.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: net: phy: realtek: add rtl8201f driver
Date: Wed, 8 May 2013 12:41:20 +0200	[thread overview]
Message-ID: <20130508104119.GA24905@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <201305081910.27203.neidhard.kim@lge.com>

Jongsung Kim <neidhard.kim@lge.com> :
> This patch adds the minimal driver to manage the
> Realtek RTL8201F 10/100Mbps Transceivers.

Your patch contains both "remove unused #define" and "support new hardware"
parts. I am not sure that the former is adequate for submission until
net-next opens.

> diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
[...]
> +static int rtl8201f_config_intr(struct phy_device *phydev)
> +{
> +	int err;
> +
> +	phy_write(phydev, RTL8201F_PSR, 0x0007);	/* select page 7 */

static void rtl8201f_page_select(struct phy_device *phydev, int page) ?

[...]
> @@ -96,16 +141,16 @@ static struct phy_driver rtl8211e_driver = {
>  
>  static int __init realtek_init(void)
>  {
> -	int ret;
> -
> -	ret = phy_driver_register(&rtl8211b_driver);
> -	if (ret < 0)
> +	if(phy_driver_register(&rtl8201f_driver) < 0)
         ^^ -> missing space.

> +		return -ENODEV;

Please propagate phy_driver_register error code.

> +	if(phy_driver_register(&rtl8211b_driver) < 0)
>  		return -ENODEV;
>  	return phy_driver_register(&rtl8211e_driver);

Unbalanced error paths.

>  }
>  
>  static void __exit realtek_exit(void)
>  {
> +	phy_driver_unregister(&rtl8201f_driver);
>  	phy_driver_unregister(&rtl8211b_driver);
>  	phy_driver_unregister(&rtl8211e_driver);

Code duplication.

You may use an array of phy_driver for realtek_{init/exit}

-- 
Ueimor

  reply	other threads:[~2013-05-08 10:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-08 10:10 Jongsung Kim
2013-05-08 10:41 ` Francois Romieu [this message]
2013-05-09  2:26   ` Jongsung Kim
2013-05-08 15:43 ` Sergei Shtylyov
2013-05-09  2:35   ` Jongsung Kim
2013-05-09 16:58     ` Sergei Shtylyov
2013-05-10  3:44       ` Jongsung Kim
2013-05-10  7:29 ` [PATCH v2 1/4] net: phy: realtek: simplify multiple drivers registration Jongsung Kim
2013-05-10  7:29 ` [PATCH v2 2/4] net: phy: realtek: add support for the RTL8201F Jongsung Kim
2013-05-10  7:29 ` [PATCH v2 3/4] net: phy: realtek: add suspend/resume handlers for the RTL8211B Jongsung Kim
2013-05-10  7:29 ` [PATCH v2 4/4] net: phy: realtek: cleanup code Jongsung Kim
2013-05-10 11:18   ` Sergei Shtylyov
2013-05-13  2:48     ` Jongsung Kim
2013-05-13  9:58     ` [PATCH v3 1/4] net: phy: realtek: simplify multiple drivers registration Jongsung Kim
2013-05-13  9:58     ` [PATCH v3 2/4] net: phy: realtek: add support for the RTL8201F Jongsung Kim
2013-05-13  9:58     ` [PATCH v3 3/4] net: phy: realtek: add suspend/resume handlers for the RTL8211B Jongsung Kim
2013-05-13  9:58     ` [PATCH v3 4/4] net: phy: realtek: cleanup code Jongsung Kim

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=20130508104119.GA24905@electric-eye.fr.zoreil.com \
    --to=romieu@fr.zoreil.com \
    --cc=chohnstaedt@innominate.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neidhard.kim@lge.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.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®