When the CCF is activated, the dev->parent is not necessary
the reference to SCMI transport and the function devm_scmi_of_get_channel
failed for the registered SCMI clock, child for protocol@14,
the channel is null and the SCMI clock driver crash for any operations.
This patch changes the first parameter of the ops of_get_channel(),
aligned with other process_msg() to pass directly the good reference,
i.e. parent result of find_scmi_transport_device(dev)
which return the reference of the scmi transport device.
Fixes: 8e96801aa6a ("firmware: scmi: add multi-channel support")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
static int scmi_mbox_get_channel(struct udevice *dev,
struct scmi_channel **channel)
{
- struct scmi_mbox_channel *base_chan = dev_get_plat(dev->parent);
+ struct scmi_mbox_channel *base_chan = dev_get_plat(dev);
struct scmi_mbox_channel *chan;
int ret;
static int scmi_optee_get_channel(struct udevice *dev,
struct scmi_channel **channel)
{
- struct scmi_optee_channel *base_chan = dev_get_plat(dev->parent);
+ struct scmi_optee_channel *base_chan = dev_get_plat(dev);
struct scmi_optee_channel *chan;
u32 channel_id;
int ret;
return -ENODEV;
if (transport_dev_ops(parent)->of_get_channel)
- return transport_dev_ops(parent)->of_get_channel(dev, channel);
+ return transport_dev_ops(parent)->of_get_channel(parent, channel);
/* Drivers without a get_channel operator don't need a channel ref */
*channel = NULL;
static int scmi_smccc_get_channel(struct udevice *dev,
struct scmi_channel **channel)
{
- struct scmi_smccc_channel *base_chan = dev_get_plat(dev->parent);
+ struct scmi_smccc_channel *base_chan = dev_get_plat(dev);
struct scmi_smccc_channel *chan;
u32 func_id;
int ret;