From: Rosen Penev <rosenp@gmail.com>
To: netdev@vger.kernel.org
Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org,
steve.glendinning@shawell.net
Subject: [PATCHv2 net-next 9/9] net: smsc911x: move reset_gpio member down
Date: Tue, 1 Oct 2024 11:29:16 -0700 [thread overview]
Message-ID: <20241001182916.122259-10-rosenp@gmail.com> (raw)
In-Reply-To: <20241001182916.122259-1-rosenp@gmail.com>
Not needed in struct. It seems to be unused actually.
Add error handling to avoid unused variable errors and to handle
-EPROBE_DEFER, if applicable.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/ethernet/smsc/smsc911x.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 77a5b766751c..3b2388c1c939 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -131,9 +131,6 @@ struct smsc911x_data {
/* register access functions */
const struct smsc911x_ops *ops;
-
- /* Reset GPIO */
- struct gpio_desc *reset_gpiod;
};
/* Easy access to information */
@@ -369,14 +366,15 @@ smsc911x_rx_readfifo_shift(struct smsc911x_data *pdata, unsigned int *buf,
static int smsc911x_request_resources(struct platform_device *pdev)
{
static const char *const supplies[] = { "vdd33a", "vddvario" };
- struct net_device *ndev = platform_get_drvdata(pdev);
- struct smsc911x_data *pdata = netdev_priv(ndev);
+ struct gpio_desc *reset_gpiod;
struct clk *clk;
/* Request optional RESET GPIO */
- pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev,
- "reset",
- GPIOD_OUT_LOW);
+ reset_gpiod =
+ devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW);
+ if (IS_ERR(reset_gpiod))
+ return dev_err_probe(&pdev->dev, PTR_ERR(reset_gpiod),
+ "GPIO device not found");
/* Request clock */
clk = devm_clk_get_optional(&pdev->dev, NULL);
--
2.46.2
prev parent reply other threads:[~2024-10-01 18:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-01 18:29 [PATCHv2 net-next 0/9] clean up with devm Rosen Penev
2024-10-01 18:29 ` [PATCHv2 net-next 1/9] net: smsc911x: use devm_platform_ioremap_resource Rosen Penev
2024-10-01 22:22 ` Andrew Lunn
2024-10-01 18:29 ` [PATCHv2 net-next 2/9] net: smsc911x: use devm_alloc_etherdev Rosen Penev
2024-10-01 22:24 ` Andrew Lunn
2024-10-01 18:29 ` [PATCHv2 net-next 3/9] net: smsc911x: use devm for regulators Rosen Penev
2024-10-01 22:27 ` Andrew Lunn
2024-10-01 23:44 ` Rosen Penev
2024-10-01 18:29 ` [PATCHv2 net-next 4/9] net: smsc911x: use devm for mdiobus functions Rosen Penev
2024-10-01 22:28 ` Andrew Lunn
2024-10-01 18:29 ` [PATCHv2 net-next 5/9] net: smsc911x: use devm for register_netdev Rosen Penev
2024-10-01 22:30 ` Andrew Lunn
2024-10-01 18:29 ` [PATCHv2 net-next 6/9] net: smsc911x: remove debug stuff from _remove Rosen Penev
2024-10-01 22:30 ` Andrew Lunn
2024-10-01 18:29 ` [PATCHv2 net-next 7/9] net: smsc911x: remove pointless NULL checks Rosen Penev
2024-10-01 18:29 ` [PATCHv2 net-next 8/9] net: smsc911x: remove enable_resources function Rosen Penev
2024-10-01 18:29 ` Rosen Penev [this message]
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=20241001182916.122259-10-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=steve.glendinning@shawell.net \
/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®