All of lore.kernel.org
 help / color / mirror / Atom feed
From: yankejian@huawei.com (Yankejian (Hackim Yim))
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next 1/2] net: hns: enet specisies a reference to dsaf
Date: Wed, 9 Dec 2015 18:39:59 +0800	[thread overview]
Message-ID: <566804FF.5000607@huawei.com> (raw)
In-Reply-To: <56671D27.5070700@gmail.com>



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

WARNING: multiple messages have this Message-ID (diff)
From: "Yankejian (Hackim Yim)" <yankejian@huawei.com>
To: Florian Fainelli <f.fainelli@gmail.com>,
	davem@davemloft.net, arnd@arndb.de, fengguang.wu@intel.com,
	robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	catalin.marinas@arm.com, will.deacon@arm.com,
	salil.mehta@huawei.com, Yisen.Zhuang@huawei.com,
	liguozhu@huawei.com, lisheng011@huawei.com,
	huangdaode@hisilicon.com, xuwei5@hisilicon.com
Cc: devicetree@vger.kernel.org, haifeng.wei@huawei.com,
	netdev@vger.kernel.org, linuxarm@huawei.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net-next 1/2] net: hns: enet specisies a reference to dsaf
Date: Wed, 9 Dec 2015 18:39:59 +0800	[thread overview]
Message-ID: <566804FF.5000607@huawei.com> (raw)
In-Reply-To: <56671D27.5070700@gmail.com>



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

WARNING: multiple messages have this Message-ID (diff)
From: "Yankejian (Hackim Yim)" <yankejian@huawei.com>
To: Florian Fainelli <f.fainelli@gmail.com>, <davem@davemloft.net>,
	<arnd@arndb.de>, <fengguang.wu@intel.com>, <robh+dt@kernel.org>,
	<pawel.moll@arm.com>, <mark.rutland@arm.com>,
	<ijc+devicetree@hellion.org.uk>, <galak@codeaurora.org>,
	<catalin.marinas@arm.com>, <will.deacon@arm.com>,
	<salil.mehta@huawei.com>, <Yisen.Zhuang@huawei.com>,
	<liguozhu@huawei.com>, <lisheng011@huawei.com>,
	<huangdaode@hisilicon.com>, <xuwei5@hisilicon.com>
Cc: <devicetree@vger.kernel.org>, <haifeng.wei@huawei.com>,
	<netdev@vger.kernel.org>, <linuxarm@huawei.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH net-next 1/2] net: hns: enet specisies a reference to dsaf
Date: Wed, 9 Dec 2015 18:39:59 +0800	[thread overview]
Message-ID: <566804FF.5000607@huawei.com> (raw)
In-Reply-To: <56671D27.5070700@gmail.com>



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




  reply	other threads:[~2015-12-09 10:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-05  7:59 [PATCH net-next 0/2] net: hns: enet specisies a reference to dsaf yankejian
2015-12-05  7:59 ` yankejian
2015-12-05  7:59 ` yankejian
2015-12-05  7:59 ` yankejian
2015-12-05  7:59 ` [PATCH net-next 1/2] " yankejian
2015-12-05  7:59   ` yankejian
2015-12-05  7:59   ` yankejian
2015-12-05  7:59   ` yankejian
2015-12-08 18:10   ` Florian Fainelli
2015-12-08 18:10     ` Florian Fainelli
2015-12-08 18:10     ` Florian Fainelli
2015-12-09 10:39     ` Yankejian (Hackim Yim) [this message]
2015-12-09 10:39       ` Yankejian (Hackim Yim)
2015-12-09 10:39       ` Yankejian (Hackim Yim)
2015-12-05  7:59 ` [PATCH net-next 2/2] net: hns: enet specisies a reference to dsaf (config and documents) yankejian
2015-12-05  7:59   ` yankejian
2015-12-05  7:59   ` yankejian
2015-12-05  7:59   ` yankejian
2015-12-07 14:12   ` Rob Herring
2015-12-07 14:12     ` Rob Herring
2015-12-08 12:21     ` Yankejian (Hackim Yim)
2015-12-08 12:21       ` Yankejian (Hackim Yim)
2015-12-08 12:21       ` Yankejian (Hackim Yim)
  -- strict thread matches above, loose matches on Subject: below --
2015-12-05  6:10 [PATCH net-next 0/2] net: hns: enet specisies a reference to dsaf yankejian
2015-12-05  6:10 ` [PATCH net-next 1/2] " yankejian
2015-12-05  6:10   ` yankejian
2015-12-05  6:10   ` yankejian

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=566804FF.5000607@huawei.com \
    --to=yankejian@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.