From: Hans de Goede <hdegoede@redhat.com>
To: Chen Ni <nichen@iscas.ac.cn>,
ilpo.jarvinen@linux.intel.com, vadimp@nvidia.com
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/mellanox: nvsw-sn2201: Add check for platform_device_add_resources
Date: Mon, 24 Jun 2024 13:20:42 +0200 [thread overview]
Message-ID: <2b3e519e-10ab-4785-9a3a-6454b18c169d@redhat.com> (raw)
In-Reply-To: <20240605032745.2916183-1-nichen@iscas.ac.cn>
Hi,
On 6/5/24 5:27 AM, Chen Ni wrote:
> Add check for the return value of platform_device_add_resources() and
> return the error if it fails in order to catch the error.
>
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
I will include this patch in my next fixes pull-req to Linus
for the current kernel development cycle.
Regards,
Hans
> ---
> drivers/platform/mellanox/nvsw-sn2201.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c
> index 3ef655591424..abe7be602f84 100644
> --- a/drivers/platform/mellanox/nvsw-sn2201.c
> +++ b/drivers/platform/mellanox/nvsw-sn2201.c
> @@ -1198,6 +1198,7 @@ static int nvsw_sn2201_config_pre_init(struct nvsw_sn2201 *nvsw_sn2201)
> static int nvsw_sn2201_probe(struct platform_device *pdev)
> {
> struct nvsw_sn2201 *nvsw_sn2201;
> + int ret;
>
> nvsw_sn2201 = devm_kzalloc(&pdev->dev, sizeof(*nvsw_sn2201), GFP_KERNEL);
> if (!nvsw_sn2201)
> @@ -1205,8 +1206,10 @@ static int nvsw_sn2201_probe(struct platform_device *pdev)
>
> nvsw_sn2201->dev = &pdev->dev;
> platform_set_drvdata(pdev, nvsw_sn2201);
> - platform_device_add_resources(pdev, nvsw_sn2201_lpc_io_resources,
> + ret = platform_device_add_resources(pdev, nvsw_sn2201_lpc_io_resources,
> ARRAY_SIZE(nvsw_sn2201_lpc_io_resources));
> + if (ret)
> + return ret;
>
> nvsw_sn2201->main_mux_deferred_nr = NVSW_SN2201_MAIN_MUX_DEFER_NR;
> nvsw_sn2201->main_mux_devs = nvsw_sn2201_main_mux_brdinfo;
prev parent reply other threads:[~2024-06-24 11:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 3:27 Chen Ni
2024-06-24 11:20 ` Hans de Goede [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=2b3e519e-10ab-4785-9a3a-6454b18c169d@redhat.com \
--to=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nichen@iscas.ac.cn \
--cc=platform-driver-x86@vger.kernel.org \
--cc=vadimp@nvidia.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®