Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1287409

Re: [PATCH net-next 1/2] net: hns: enet specisies a reference to dsaf

From "Yankejian (Hackim Yim)" <yankejian@huawei.com>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 1/2] net: hns: enet specisies a reference to dsaf
Date 2015-12-09 11:50 +0100
Message-ID <qDKtR-7f3-49@gated-at.bofh.it> (permalink)
References <qCfV8-6f3-3@gated-at.bofh.it> <qCfV8-6f3-5@gated-at.bofh.it> <qDv1L-5NC-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 2015/12/9 2:10, Florian Fainelli wrote:
> Subject: s/specisies/specifies/?

Thanks for pointing it out. i will change it in next patchset.

Best Regards,
yankejian

> On 04/12/15 23:59, yankejian wrote:
>> enet is associating with dasf. before this patch, the association is
>> the same strings between ae-name and dsa-name. in a general way, enet
>> specifies a reference to dsaf should be a good idea. so this patch
>> deletes the ae-name in enet, and adds parsing the ae-handle
>> from DT to set the associating with dsaf.
>>
>> Signed-off-by: yankejian <yankejian@huawei.com>
>> ---
> [snip]
>
>> diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.c b/drivers/net/ethernet/hisilicon/hns/hnae.c
>> index b364529..3bfe36f 100644
>> --- a/drivers/net/ethernet/hisilicon/hns/hnae.c
>> +++ b/drivers/net/ethernet/hisilicon/hns/hnae.c
>> @@ -95,21 +95,17 @@ static struct hnae_buf_ops hnae_bops = {
>>  static int __ae_match(struct device *dev, const void *data)
>>  {
>>  	struct hnae_ae_dev *hdev = cls_to_ae_dev(dev);
>> -	const char *ae_id = data;
>>  
>> -	if (!strncmp(ae_id, hdev->name, AE_NAME_SIZE))
>> -		return 1;
>> -
>> -	return 0;
>> +	return hdev->dev->of_node == data;
>>  }
>>  
>> -static struct hnae_ae_dev *find_ae(const char *ae_id)
>> +static struct hnae_ae_dev *find_ae(const struct device_node *ae_node)
>>  {
>>  	struct device *dev;
>>  
>> -	WARN_ON(!ae_id);
>> +	WARN_ON(!ae_node);
>>  
>> -	dev = class_find_device(hnae_class, NULL, ae_id, __ae_match);
>> +	dev = class_find_device(hnae_class, NULL, ae_node, __ae_match);
> of_find_net_device_by_node might be used for this maybe?
it needs return hnae_ae_dev so we didn't decide to use of_find_net_device_by_node.
Thanks



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 0/2] net: hns: enet specisies a reference to dsaf yankejian <yankejian@huawei.com> - 2015-12-05 09:00 +0100
  [PATCH net-next 1/2] net: hns: enet specisies a reference to dsaf yankejian <yankejian@huawei.com> - 2015-12-05 09:00 +0100
    Re: [PATCH net-next 1/2] net: hns: enet specisies a reference to  dsaf Florian Fainelli <f.fainelli@gmail.com> - 2015-12-08 19:20 +0100
      Re: [PATCH net-next 1/2] net: hns: enet specisies a reference to dsaf "Yankejian (Hackim Yim)" <yankejian@huawei.com> - 2015-12-09 11:50 +0100
  [PATCH net-next 2/2] net: hns: enet specisies a reference to dsaf (config and documents) yankejian <yankejian@huawei.com> - 2015-12-05 09:00 +0100
    Re: [PATCH net-next 2/2] net: hns: enet specisies a reference to  dsaf (config and documents) Rob Herring <robh@kernel.org> - 2015-12-07 15:20 +0100
      Re: [PATCH net-next 2/2] net: hns: enet specisies a reference to dsaf  (config and documents) "Yankejian (Hackim Yim)" <yankejian@huawei.com> - 2015-12-08 13:30 +0100

csiph-web