提交 82cea533 编写于 作者: A Arnd Bergmann 提交者: Boris Brezillon

mtd: onenand: omap2: print resource using %pR format string

The omap2 onenand driver is now available for compile-testing, which
uncovers a warning in configurations that have a 64-bit resource_size_t:

drivers/mtd/onenand/omap2.c: In function 'omap2_onenand_probe':
drivers/mtd/onenand/omap2.c:536:54: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=]
   dev_err(dev, "Cannot reserve memory region at 0x%08x, size: 0x%x\n",
drivers/mtd/onenand/omap2.c:536:66: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=]

Changing the format string to the special %pR simplifies the code
and lets it do the right thing in that configuration, while avoiding
the warning.

Fixes: a758f50f ("mtd: onenand: omap2: Configure driver from DT")
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
上级 6837befd
......@@ -533,8 +533,7 @@ static int omap2_onenand_probe(struct platform_device *pdev)
c->onenand.base = devm_ioremap_resource(dev, res);
if (IS_ERR(c->onenand.base)) {
dev_err(dev, "Cannot reserve memory region at 0x%08x, size: 0x%x\n",
res->start, resource_size(res));
dev_err(dev, "Cannot reserve memory region %pR\n", res);
return PTR_ERR(c->onenand.base);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册