summaryrefslogtreecommitdiffstats
path: root/drivers/mailbox/mailbox-xgene-slimpro.c
AgeCommit message (Collapse)AuthorFilesLines
2018-12-21mailbox: xgene-slimpro: Use device-managed registration APIThierry Reding1-10/+1
Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2018-08-03mailbox: xgene-slimpro: Fix potential NULL pointer dereferenceGustavo A. R. Silva1-3/+3
There is a potential execution path in which function platform_get_resource() returns NULL. If this happens, we will end up having a NULL pointer dereference. Fix this by replacing devm_ioremap with devm_ioremap_resource, which has the NULL check and the memory region request. This code was detected with the help of Coccinelle. Cc: stable@vger.kernel.org Fixes: f700e84f417b ("mailbox: Add support for APM X-Gene platform mailbox driver") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2017-03-28mailbox: constify mbox_chan_ops structuresBhumika Goyal1-1/+1
Check for mbox_chan_ops structures that are only stored in the ops field of a mbox_controller structure. This field is of type const struct mbox_chan_ops *, so mbox_chan_ops structures having this property can be declared as const. Done using Coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ struct mbox_chan_ops i@p = {...}; @ok1@ identifier r1.i; struct hi6220_mbox mbox; struct slimpro_mbox ctx; position p; @@ ( mbox.controller.ops=&i@p | ctx.mb_ctrl.ops=&i@p ) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct mbox_chan_ops i; File size details: text data bss dec hex filename 2310 248 0 2558 9fe drivers/mailbox/hi6220-mailbox.o 2366 192 0 2558 9fe drivers/mailbox/hi6220-mailbox.o 1500 248 0 1748 6d4 mailbox/mailbox-xgene-slimpro.o 1556 192 0 1748 6d4 mailbox/mailbox-xgene-slimpro.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-04-08mailbox: xgene-slimpro: Fix wrong test for devm_kzallocAxel Lin1-2/+2
devm_kzalloc() returns NULL on failure. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-03-04mailbox/xgene-slimpro: Checking for IS_ERR instead of NULLDan Carpenter1-2/+2
devm_ioremap() returns NULL, it never returns an ERR_PTR. Fixes: f700e84f417b ('mailbox: Add support for APM X-Gene platform mailbox driver') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-02-15mailbox: Add support for APM X-Gene platform mailbox driverDuc Dang1-0/+284
X-Gene mailbox controller provides 8 mailbox channels, with each channel has a dedicated interrupt line. Signed-off-by: Feng Kan <fkan@apm.com> Signed-off-by: Duc Dang <dhdang@apm.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>