mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Parthiban.Veerasooran@microchip.com>
To: <danishanwar@ti.com>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<horms@kernel.org>, <corbet@lwn.net>, <nm@ti.com>,
	<vigneshr@ti.com>, <kristo@kernel.org>, <robh@kernel.org>,
	<krzk+dt@kernel.org>, <conor+dt@kernel.org>,
	<andrew+netdev@lunn.ch>, <mengyuanlou@net-swift.com>,
	<quic_luoj@quicinc.com>, <gongfan1@huawei.com>,
	<quic_leiwei@quicinc.com>, <mpe@ellerman.id.au>, <lee@trager.us>,
	<lorenzo@kernel.org>, <geert+renesas@glider.be>,
	<lukas.bulwahn@redhat.com>
Cc: <netdev@vger.kernel.org>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH net-next v3 4/7] net: rpmsg-eth: Add netdev ops
Date: Tue, 9 Sep 2025 06:38:56 +0000	[thread overview]
Message-ID: <4a69e4f1-06b1-49a1-aab6-baef6c613f0b@microchip.com> (raw)
In-Reply-To: <20250908090746.862407-5-danishanwar@ti.com>

Hi,

On 08/09/25 2:37 pm, MD Danish Anwar wrote:

> +static int create_request(struct rpmsg_eth_common *common,
> +                         enum rpmsg_eth_rpmsg_type rpmsg_type)
> +{
> +       struct message *msg = &common->send_msg;
> +       int ret = 0;
> +
> +       msg->msg_hdr.src_id = common->port->port_id;
> +       msg->req_msg.type = rpmsg_type;
> +
> +       switch (rpmsg_type) {
> +       case RPMSG_ETH_REQ_SHM_INFO:
> +               msg->msg_hdr.msg_type = RPMSG_ETH_REQUEST_MSG;
> +               break;
> +       case RPMSG_ETH_REQ_SET_MAC_ADDR:
> +               msg->msg_hdr.msg_type = RPMSG_ETH_REQUEST_MSG;
> +               ether_addr_copy(msg->req_msg.mac_addr.addr,
> +                               common->port->ndev->dev_addr);
> +               break;
> +       case RPMSG_ETH_NOTIFY_PORT_UP:
> +       case RPMSG_ETH_NOTIFY_PORT_DOWN:
> +               msg->msg_hdr.msg_type = RPMSG_ETH_NOTIFY_MSG;
> +               break;
> +       default:
> +               ret = -EINVAL;
> +               dev_err(common->dev, "Invalid RPMSG request\n");
I don't think you need 'ret' here instead directly return -EINVAL and 
above 'ret' declaration can be removed.
> +       }
> +       return ret;
can be return 0;
> +}
> +
> +static int rpmsg_eth_create_send_request(struct rpmsg_eth_common *common,
> +                                        enum rpmsg_eth_rpmsg_type rpmsg_type,
> +                                        bool wait)
> +{
> +       unsigned long flags;
> +       int ret = 0;
No need to initialize.
> +
> +       if (wait)
> +               reinit_completion(&common->sync_msg);
> +
> +       spin_lock_irqsave(&common->send_msg_lock, flags);
> +
> +static int rpmsg_eth_set_mac_address(struct net_device *ndev, void *addr)
> +{
> +       struct rpmsg_eth_common *common = rpmsg_eth_ndev_to_common(ndev);
> +       int ret;
> +
> +       ret = eth_mac_addr(ndev, addr);
> +
> +       if (ret < 0)
> +               return ret;
> +       ret = rpmsg_eth_create_send_request(common, RPMSG_ETH_REQ_SET_MAC_ADDR, false);
You can directly return from here.
> +       return ret;
> +}
> +
Best regards,
Parthiban V

  reply	other threads:[~2025-09-09  6:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08  9:07 [PATCH net-next v3 0/7] Add RPMSG Ethernet Driver MD Danish Anwar
2025-09-08  9:07 ` [PATCH net-next v3 1/7] net: rpmsg-eth: Add Documentation for RPMSG-ETH Driver MD Danish Anwar
2025-09-08  9:07 ` [PATCH net-next v3 2/7] net: rpmsg-eth: Add basic rpmsg skeleton MD Danish Anwar
2025-09-10 14:22   ` kernel test robot
2025-09-08  9:07 ` [PATCH net-next v3 3/7] net: rpmsg-eth: Register device as netdev MD Danish Anwar
2025-09-08  9:07 ` [PATCH net-next v3 4/7] net: rpmsg-eth: Add netdev ops MD Danish Anwar
2025-09-09  6:38   ` Parthiban.Veerasooran [this message]
2025-09-09 14:08     ` Anwar, Md Danish
2025-09-08  9:07 ` [PATCH net-next v3 5/7] net: rpmsg-eth: Add support for multicast filtering MD Danish Anwar
2025-09-08  9:07 ` [PATCH net-next v3 6/7] MAINTAINERS: Add entry for RPMSG Ethernet driver MD Danish Anwar
2025-09-08  9:07 ` [PATCH net-next v3 7/7] arch: arm64: dts: k3-am64*: Add rpmsg-eth node MD Danish Anwar

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=4a69e4f1-06b1-49a1-aab6-baef6c613f0b@microchip.com \
    --to=parthiban.veerasooran@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=geert+renesas@glider.be \
    --cc=gongfan1@huawei.com \
    --cc=horms@kernel.org \
    --cc=kristo@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lee@trager.us \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=lukas.bulwahn@redhat.com \
    --cc=mengyuanlou@net-swift.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pabeni@redhat.com \
    --cc=quic_leiwei@quicinc.com \
    --cc=quic_luoj@quicinc.com \
    --cc=robh@kernel.org \
    --cc=vigneshr@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®