From: Yeoreum Yun <yeoreum.yun@arm.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] firmware/arm_ffa: change ffa_device_register()'s parameters and return
Date: Tue, 3 Dec 2024 14:09:47 +0000 [thread overview]
Message-ID: <Z08RK7JWG6ko1yvt@e129823.arm.com> (raw)
In-Reply-To: <Z072CGn6fhnT0hED@bogus>
Hi Sudeep.
> > ffa_dev = kzalloc(sizeof(*ffa_dev), GFP_KERNEL);
> > if (!ffa_dev) {
> > ida_free(&ffa_bus_id, id);
> > - return NULL;
> > + return ERR_PTR(-ENOMEM);
>
> I am not keen on changing the error from NULL here. -ENOMEM has its own
> logging. ida_alloc failing is very unlikely unless you have so many
> partitions in the system.
>
Okay I'll restore.
> > }
> >
> > dev = &ffa_dev->dev;
> > @@ -210,16 +216,18 @@ struct ffa_device *ffa_device_register(const uuid_t *uuid, int vm_id,
> > dev_set_name(&ffa_dev->dev, "arm-ffa-%d", id);
> >
> > ffa_dev->id = id;
> > - ffa_dev->vm_id = vm_id;
> > + ffa_dev->vm_id = part_info->id;
> > + ffa_dev->properties = part_info->properties;
> > ffa_dev->ops = ops;
> > - uuid_copy(&ffa_dev->uuid, uuid);
> > + import_uuid(&uuid, (u8 *)part_info->uuid);
> > + uuid_copy(&ffa_dev->uuid, &uuid);
> >
> > ret = device_register(&ffa_dev->dev);
> > if (ret) {
> > dev_err(dev, "unable to register device %s err=%d\n",
> > dev_name(dev), ret);
>
> This error log will give the information you are adding in driver.c, so
> it is again not needed to change that.
>
> > put_device(dev);
> > - return NULL;
> > + return ERR_PTR(ret);
> > }
> >
> > return ffa_dev;
> > diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
> > index b14cbdae94e8..a3a9cdec7389 100644
> > --- a/drivers/firmware/arm_ffa/driver.c
> > +++ b/drivers/firmware/arm_ffa/driver.c
> > @@ -1406,23 +1406,19 @@ static int ffa_setup_partitions(void)
> >
> > xa_init(&drv_info->partition_info);
> > for (idx = 0, tpbuf = pbuf; idx < count; idx++, tpbuf++) {
> > - import_uuid(&uuid, (u8 *)tpbuf->uuid);
> > -
> > /* Note that if the UUID will be uuid_null, that will require
> > * ffa_bus_notifier() to find the UUID of this partition id
> > * with help of ffa_device_match_uuid(). FF-A v1.1 and above
> > * provides UUID here for each partition as part of the
> > * discovery API and the same is passed.
> > */
> > - ffa_dev = ffa_device_register(&uuid, tpbuf->id, &ffa_drv_ops);
> > - if (!ffa_dev) {
> > - pr_err("%s: failed to register partition ID 0x%x\n",
> > - __func__, tpbuf->id);
> > + ffa_dev = ffa_device_register(tpbuf, &ffa_drv_ops);
> > + if (IS_ERR_OR_NULL(ffa_dev)) {
> > + pr_err("%s: failed to register partition ID 0x%x, error %ld\n",
> > + __func__, tpbuf->id, PTR_ERR(ffa_dev));
>
> Drop this additional error info you are adding as bus.c will provide it.
Okay. Thanks!
next prev parent reply other threads:[~2024-12-03 14:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 9:52 [PATCH 0/3] small fixes for arm_ffa driver Yeoreum Yun
2024-11-25 9:52 ` [PATCH 1/3] firmware/arm_ffa: change ffa_device_register()'s parameters and return Yeoreum Yun
2024-12-03 12:14 ` Sudeep Holla
2024-12-03 14:09 ` Yeoreum Yun [this message]
2024-11-25 9:52 ` [PATCH 2/3] arm_ffa.h: add properties bit related direct msg version 2 Yeoreum Yun
2024-12-03 12:14 ` Sudeep Holla
2024-11-25 9:52 ` [PATCH 3/3] firmware/arm_ffa: remove __le64_to_cpu() when set uuid for direct msg v2 Yeoreum Yun
2024-12-03 12:14 ` Sudeep Holla
2024-12-03 13:33 ` Yeoreum Yun
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=Z08RK7JWG6ko1yvt@e129823.arm.com \
--to=yeoreum.yun@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sudeep.holla@arm.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;
as well as URLs for NNTP newsgroup(s).