Re: [PATCH net-next] r8153_ecm: avoid to be prior to r8152 driver

From: Jakub Kicinski
Date: Tue Nov 17 2020 - 11:12:18 EST


On Tue, 17 Nov 2020 01:50:03 +0000 Hayes Wang wrote:
> Jakub Kicinski <kuba@xxxxxxxxxx>
> > Sent: Tuesday, November 17, 2020 1:03 AM
> [...]
> > > Yes, this fixes this issue, although I would prefer a separate Kconfig
> > > entry for r8153_ecm with proper dependencies instead of this ifdefs in
> > > Makefile.
> >
> > Agreed, this is what dependency resolution is for.
> >
> > Let's just make this a separate Kconfig entry.
>
> Excuse me. I am not familiar with Kconfig.
>
> I wish r8153_ecm could be used, even
> CONFIG_USB_RTL8152 is not defined.
>
> How should set it in Kconfig?

Something like this?

config USB_RTL8153_ECM
tristate <headline text>
select MII
select USB_NET_CDCETHER
depends on USB_RTL8152 || USB_RTL8152=n
help
<you help text>


select clauses will pull in the dependencies you need, and the
dependency on RTL8152 will be satisfied either when RTL8152's code
is reachable (both are modules or RTL8152 is built in) or when RTL8152
is not built at all.

Does that help?