All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Leon Romanovsky <leon@kernel.org>, Peter Geis <pgwipeout@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Russell King <linux@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>
Subject: Re: [PATCH] net: phy: add driver for Motorcomm yt8511 phy
Date: Wed, 19 May 2021 12:37:43 +0200	[thread overview]
Message-ID: <cbfecaf2-2991-c79e-ba80-c805d119ac2f@gmail.com> (raw)
In-Reply-To: <YKTJwscaV1WaK98z@unreal>

On 19.05.2021 10:18, Leon Romanovsky wrote:
> On Tue, May 18, 2021 at 08:20:03PM -0400, Peter Geis wrote:
>> On Tue, May 18, 2021 at 4:59 AM Leon Romanovsky <leon@kernel.org> wrote:
>>>
>>> On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
>>>> Add a driver for the Motorcomm yt8511 phy that will be used in the
>>>> production Pine64 rk3566-quartz64 development board.
>>>> It supports gigabit transfer speeds, rgmii, and 125mhz clk output.
>>>>
>>>> Signed-off-by: Peter Geis <pgwipeout@gmail.com>
>>>> ---
>>>>  MAINTAINERS                 |  6 +++
>>>>  drivers/net/phy/Kconfig     |  6 +++
>>>>  drivers/net/phy/Makefile    |  1 +
>>>>  drivers/net/phy/motorcomm.c | 85 +++++++++++++++++++++++++++++++++++++
>>>>  4 files changed, 98 insertions(+)
>>>>  create mode 100644 drivers/net/phy/motorcomm.c
>>>
>>> <...>
>>>
>>>> +static const struct mdio_device_id __maybe_unused motorcomm_tbl[] = {
>>>> +     { PHY_ID_MATCH_EXACT(PHY_ID_YT8511) },
>>>> +     { /* sentinal */ }
>>>> +}
>>>
>>> Why is this "__maybe_unused"? This *.c file doesn't have any compilation option
>>> to compile part of it.
>>>
>>> The "__maybe_unused" is not needed in this case.
>>
>> I was simply following convention, for example the realtek.c,
>> micrel.c, and smsc.c drivers all have this as well.
> 
> Maybe they have a reason, but this specific driver doesn't have such.
> 

It's used like this:
MODULE_DEVICE_TABLE(mdio, <mdio_device_id_tbl>);

And MODULE_DEVICE_TABLE is a no-op if MODULE isn't defined:

#ifdef MODULE
/* Creates an alias so file2alias.c can find device table. */
#define MODULE_DEVICE_TABLE(type, name)					\
extern typeof(name) __mod_##type##__##name##_device_table		\
  __attribute__ ((unused, alias(__stringify(name))))
#else  /* !MODULE */
#define MODULE_DEVICE_TABLE(type, name)
#endif

In this case the table is unused.

> Thanks
> 
>>
>>>
>>> Thanks



WARNING: multiple messages have this Message-ID (diff)
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Leon Romanovsky <leon@kernel.org>, Peter Geis <pgwipeout@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Russell King <linux@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>
Subject: Re: [PATCH] net: phy: add driver for Motorcomm yt8511 phy
Date: Wed, 19 May 2021 12:37:43 +0200	[thread overview]
Message-ID: <cbfecaf2-2991-c79e-ba80-c805d119ac2f@gmail.com> (raw)
In-Reply-To: <YKTJwscaV1WaK98z@unreal>

On 19.05.2021 10:18, Leon Romanovsky wrote:
> On Tue, May 18, 2021 at 08:20:03PM -0400, Peter Geis wrote:
>> On Tue, May 18, 2021 at 4:59 AM Leon Romanovsky <leon@kernel.org> wrote:
>>>
>>> On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
>>>> Add a driver for the Motorcomm yt8511 phy that will be used in the
>>>> production Pine64 rk3566-quartz64 development board.
>>>> It supports gigabit transfer speeds, rgmii, and 125mhz clk output.
>>>>
>>>> Signed-off-by: Peter Geis <pgwipeout@gmail.com>
>>>> ---
>>>>  MAINTAINERS                 |  6 +++
>>>>  drivers/net/phy/Kconfig     |  6 +++
>>>>  drivers/net/phy/Makefile    |  1 +
>>>>  drivers/net/phy/motorcomm.c | 85 +++++++++++++++++++++++++++++++++++++
>>>>  4 files changed, 98 insertions(+)
>>>>  create mode 100644 drivers/net/phy/motorcomm.c
>>>
>>> <...>
>>>
>>>> +static const struct mdio_device_id __maybe_unused motorcomm_tbl[] = {
>>>> +     { PHY_ID_MATCH_EXACT(PHY_ID_YT8511) },
>>>> +     { /* sentinal */ }
>>>> +}
>>>
>>> Why is this "__maybe_unused"? This *.c file doesn't have any compilation option
>>> to compile part of it.
>>>
>>> The "__maybe_unused" is not needed in this case.
>>
>> I was simply following convention, for example the realtek.c,
>> micrel.c, and smsc.c drivers all have this as well.
> 
> Maybe they have a reason, but this specific driver doesn't have such.
> 

It's used like this:
MODULE_DEVICE_TABLE(mdio, <mdio_device_id_tbl>);

And MODULE_DEVICE_TABLE is a no-op if MODULE isn't defined:

#ifdef MODULE
/* Creates an alias so file2alias.c can find device table. */
#define MODULE_DEVICE_TABLE(type, name)					\
extern typeof(name) __mod_##type##__##name##_device_table		\
  __attribute__ ((unused, alias(__stringify(name))))
#else  /* !MODULE */
#define MODULE_DEVICE_TABLE(type, name)
#endif

In this case the table is unused.

> Thanks
> 
>>
>>>
>>> Thanks



_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2021-05-19 10:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 21:46 [PATCH] net: phy: add driver for Motorcomm yt8511 phy Peter Geis
2021-05-11 21:46 ` Peter Geis
2021-05-11 21:56 ` Russell King - ARM Linux admin
2021-05-11 21:56   ` Russell King - ARM Linux admin
2021-05-11 22:56   ` Peter Geis
2021-05-11 22:56     ` Peter Geis
2021-05-18  8:59 ` Leon Romanovsky
2021-05-18  8:59   ` Leon Romanovsky
2021-05-19  0:20   ` Peter Geis
2021-05-19  0:20     ` Peter Geis
2021-05-19  8:18     ` Leon Romanovsky
2021-05-19  8:18       ` Leon Romanovsky
2021-05-19 10:37       ` Heiner Kallweit [this message]
2021-05-19 10:37         ` Heiner Kallweit
2021-05-19 11:50         ` Leon Romanovsky
2021-05-19 11:50           ` Leon Romanovsky
2021-05-19 12:45           ` Peter Geis
2021-05-19 12:45             ` Peter Geis
2021-05-19 12:56             ` Leon Romanovsky
2021-05-19 12:56               ` Leon Romanovsky
2021-05-19 13:15               ` Russell King (Oracle)
2021-05-19 13:15                 ` Russell King (Oracle)
2021-05-19 13:25                 ` Peter Geis
2021-05-19 13:25                   ` Peter Geis

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=cbfecaf2-2991-c79e-ba80-c805d119ac2f@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pgwipeout@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.