ret = PTR_ERR(priv->tx_ch);
dev_dbg(cl->dev, "failed to request tx mailbox channel: %d\n",
ret);
- goto err_out;
+ return ret;
}
/* Channel for receiving message */
ret = PTR_ERR(priv->rx_ch);
dev_dbg(cl->dev, "failed to request rx mailbox channel: %d\n",
ret);
- goto err_out;
+ goto free_channel_tx;
}
cl = &priv->cl_rxdb;
ret = PTR_ERR(priv->rxdb_ch);
dev_dbg(cl->dev, "failed to request mbox chan rxdb, ret %d\n",
ret);
- goto err_out;
+ goto free_channel_rx;
}
return 0;
-err_out:
- if (!IS_ERR(priv->tx_ch))
- mbox_free_channel(priv->tx_ch);
- if (!IS_ERR(priv->rx_ch))
- mbox_free_channel(priv->rx_ch);
- if (!IS_ERR(priv->rxdb_ch))
- mbox_free_channel(priv->rxdb_ch);
-
+free_channel_rx:
+ mbox_free_channel(priv->rx_ch);
+free_channel_tx:
+ mbox_free_channel(priv->tx_ch);
return ret;
}