From: Jakub Kicinski <k...@kernel.org>
Date: Wed, 1 Jul 2020 12:11:31 -0700

> On Wed, 1 Jul 2020 15:55:10 +0100 Edward Cree wrote:
>> Also, condition on revision in ethtool drvinfo: if rev is EF100, then
>>  we must be the sfc_ef100 driver.  (We can't rely on KBUILD_MODNAME
>>  any more, because ethtool_common.o gets linked into both drivers.)
>> 
>> Signed-off-by: Edward Cree <ec...@solarflare.com>
>> ---
>>  drivers/net/ethernet/sfc/ethtool_common.c | 5 ++++-
>>  drivers/net/ethernet/sfc/nic_common.h     | 1 +
>>  2 files changed, 5 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/net/ethernet/sfc/ethtool_common.c 
>> b/drivers/net/ethernet/sfc/ethtool_common.c
>> index 37a4409e759e..926deb22ee67 100644
>> --- a/drivers/net/ethernet/sfc/ethtool_common.c
>> +++ b/drivers/net/ethernet/sfc/ethtool_common.c
>> @@ -104,7 +104,10 @@ void efx_ethtool_get_drvinfo(struct net_device *net_dev,
>>  {
>>      struct efx_nic *efx = netdev_priv(net_dev);
>>  
>> -    strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
>> +    if (efx->type->revision == EFX_REV_EF100)
>> +            strlcpy(info->driver, "sfc_ef100", sizeof(info->driver));
>> +    else
>> +            strlcpy(info->driver, "sfc", sizeof(info->driver));
> 
> ethtool info -> driver does not seem like an appropriate place to
> report hardware version.

Agreed.

Or is this code used as a library by two "drivers"?  In that case it's fine.

Reply via email to