mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe
Hello Sudeep Holla,
The patch ce028702ddbc: "mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe" from Sep 17, 2021, leads to the following Smatch static checker warning:
drivers/mailbox/pcc.c:292 pcc_mbox_request_channel()
error: uninitialized symbol 'dev'.
drivers/mailbox/pcc.c
282 struct mbox_chan *chan;
283 struct device *dev;
284 unsigned long flags;
285
286 if (subspace_id < 0 || subspace_id >= pcc_chan_count)
287 return ERR_PTR(-ENOENT);
288
289 pchan = chan_info + subspace_id;
290 chan = pchan->chan.mchan;
291 if (IS_ERR(chan) || chan->cl) {
--> 292 dev_err(dev, "Channel not found for idx: %d\n", subspace_id);
^^^"dev" is uninitialized.
293 return ERR_PTR(-EBUSY);
294 }
295 dev = chan->mbox->dev;
^^^^^^^^^^^^^^^^^^^^^^Set here.
296
297 spin_lock_irqsave(&chan->lock, flags);
298 chan->msg_free = 0;
299 chan->msg_count = 0;
300 chan->active_req = NULL;
301 chan->cl = cl;
302 init_completion(&chan->tx_complete);
303
304 if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
305 chan->txdone_method = TXDONE_BY_ACK;
306
307 spin_unlock_irqrestore(&chan->lock, flags);
308
309 if (pchan->plat_irq > 0) {
310 int rc;
311
312 rc = devm_request_irq(dev, pchan->plat_irq, pcc_mbox_irq, 0,
313 MBOX_IRQ_NAME, chan);
314 if (unlikely(rc)) {
315 dev_err(dev, "failed to register PCC interrupt %d\n",
316 pchan->plat_irq);
317 pcc_mbox_free_channel(&pchan->chan);
318 return ERR_PTR(rc);
319 }
320 }
321
322 return &pchan->chan;
323 }regards,
dan carpenter