[PATCH 7/8] firmware: arm_scmi: transport: Add ACPI PCC transport
Sudeep Holla
sudeep.holla at arm.com
Mon Oct 20 01:47:45 PDT 2025
On Mon, Oct 20, 2025 at 11:20:08AM +0300, Dan Carpenter wrote:
> On Fri, Oct 17, 2025 at 02:23:50PM +0100, Sudeep Holla wrote:
> > +static int pcc_chan_setup(struct scmi_chan_info *cinfo, struct device *dev,
> > + bool tx)
> > +{
> > + const char *desc = tx ? "Tx" : "Rx";
> > + struct device *cdev = cinfo->dev;
> > + struct scmi_pcc *smbox;
> > + int ret, ss_id;
> > + struct mbox_client *cl;
> > +
> > + smbox = devm_kzalloc(dev, sizeof(*smbox), GFP_KERNEL);
> > + if (!smbox)
> > + return -ENOMEM;
> > +
> > + cl = &smbox->cl;
> > + cl->dev = cdev;
> > + cl->tx_prepare = tx ? tx_prepare : NULL;
> > + cl->rx_callback = rx_callback;
> > + cl->tx_block = false;
> > +
> > + ss_id = pcc_get_ss_id(cinfo->id, tx);
> > + if (ss_id < 0)
> > + return ss_id;
> > +
> > + smbox->pchan = pcc_mbox_request_channel(cl, ss_id);
> > + if (IS_ERR(smbox->pchan)) {
> > + ret = PTR_ERR(smbox->pchan);
> > + if (ret != -EPROBE_DEFER)
> > + dev_err(cdev,
> > + "failed to request SCMI %s mailbox\n", desc);
> > + return ret;
> > + }
>
> Use the dev_err_probe() function for this:
>
> smbox->pchan = pcc_mbox_request_channel(cl, ss_id);
> if (IS_ERR(smbox->pchan)
> return dev_err_probe(cdev, PTR_ERR(smbox->pchan),
> "failed to request SCMI %s mailbox\n",
> desc);
>
Good point, every time when review I think of it but apparently not when
writing code myself 😁, will fix it. Thanks!
--
Regards,
Sudeep
More information about the linux-arm-kernel
mailing list