]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
firmware: ti_sci: Fix not calling dev_err with a device
authorSean Anderson <seanga2@gmail.com>
Tue, 15 Sep 2020 14:44:38 +0000 (10:44 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 30 Sep 2020 12:52:24 +0000 (08:52 -0400)
This converts calls to dev_err to get the device from ti_sci_info where
appropriate.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
drivers/firmware/ti_sci.c

index e311f55ef821e8cf9d5d04debf57f351e9d01f11..a2beb0079d8d9b851619ed59b8017b596ce01277 100644 (file)
@@ -619,7 +619,7 @@ static int ti_sci_get_device_state(const struct ti_sci_handle *handle,
 
        ret = ti_sci_do_xfer(info, xfer);
        if (ret) {
-               dev_err(dev, "Mbox send fail %d\n", ret);
+               dev_err(info->dev, "Mbox send fail %d\n", ret);
                return ret;
        }
 
@@ -1591,7 +1591,7 @@ static int ti_sci_cmd_core_reboot(const struct ti_sci_handle *handle)
 
        ret = ti_sci_do_xfer(info, xfer);
        if (ret) {
-               dev_err(dev, "Mbox send fail %d\n", ret);
+               dev_err(info->dev, "Mbox send fail %d\n", ret);
                return ret;
        }
 
@@ -1639,7 +1639,7 @@ static int ti_sci_get_resource_range(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(dev, "Message alloc failed(%d)\n", ret);
+               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
 
@@ -1649,7 +1649,7 @@ static int ti_sci_get_resource_range(const struct ti_sci_handle *handle,
 
        ret = ti_sci_do_xfer(info, xfer);
        if (ret) {
-               dev_err(dev, "Mbox send fail %d\n", ret);
+               dev_err(info->dev, "Mbox send fail %d\n", ret);
                goto fail;
        }
 
@@ -1745,7 +1745,7 @@ static int ti_sci_cmd_query_msmc(const struct ti_sci_handle *handle,
 
        ret = ti_sci_do_xfer(info, xfer);
        if (ret) {
-               dev_err(dev, "Mbox send fail %d\n", ret);
+               dev_err(info->dev, "Mbox send fail %d\n", ret);
                return ret;
        }
 
@@ -2229,6 +2229,14 @@ static int ti_sci_cmd_proc_shutdown_no_wait(const struct ti_sci_handle *handle,
                                            u8 proc_id)
 {
        int ret;
+       struct ti_sci_info *info;
+
+       if (IS_ERR(handle))
+               return PTR_ERR(handle);
+       if (!handle)
+               return -EINVAL;
+
+       info = handle_to_ti_sci_info(handle);
 
        /*
         * Send the core boot status wait message waiting for either WFE or
@@ -2554,7 +2562,8 @@ static int ti_sci_cmd_rm_udmap_rx_flow_cfg(
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(dev, "RX_FL_CFG: Message alloc failed(%d)\n", ret);
+               dev_err(info->dev, "RX_FL_CFG: Message alloc failed(%d)\n",
+                       ret);
                return ret;
        }
 
@@ -2583,7 +2592,7 @@ static int ti_sci_cmd_rm_udmap_rx_flow_cfg(
 
        ret = ti_sci_do_xfer(info, xfer);
        if (ret) {
-               dev_err(dev, "RX_FL_CFG: Mbox send fail %d\n", ret);
+               dev_err(info->dev, "RX_FL_CFG: Mbox send fail %d\n", ret);
                goto fail;
        }