Convert users of PRINTF_CONVERSION_RESOURCE to %pa
printf now supports printing resource_size_t directly, convert all users of the previously used PRINTF_CONVERSION_RESOURCE over to %pa. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
7f2e215fcf
commit
e2306ada3e
|
@ -77,13 +77,15 @@ static int do_devinfo(int argc, char *argv[])
|
|||
if (dev->num_resources)
|
||||
printf("Resources:\n");
|
||||
for (i = 0; i < dev->num_resources; i++) {
|
||||
resource_size_t size;
|
||||
res = &dev->resource[i];
|
||||
size = resource_size(res);
|
||||
printf(" num: %d\n", i);
|
||||
if (res->name)
|
||||
printf(" name: %s\n", res->name);
|
||||
printf(" start: " PRINTF_CONVERSION_RESOURCE "\n"
|
||||
" size: " PRINTF_CONVERSION_RESOURCE "\n",
|
||||
res->start, resource_size(res));
|
||||
printf(" start: %pa\n"
|
||||
" size: %pa\n",
|
||||
&res->start, &size);
|
||||
}
|
||||
|
||||
if (dev->driver)
|
||||
|
|
|
@ -22,14 +22,14 @@
|
|||
static void __print_resources(struct resource *res, int indent)
|
||||
{
|
||||
struct resource *r;
|
||||
resource_size_t size = resource_size(res);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < indent; i++)
|
||||
printf(" ");
|
||||
|
||||
printf(PRINTF_CONVERSION_RESOURCE " - " PRINTF_CONVERSION_RESOURCE
|
||||
" (size " PRINTF_CONVERSION_RESOURCE ") %s\n",
|
||||
res->start, res->end, resource_size(res), res->name);
|
||||
printf("%pa - %pa (size %pa) %s\n",
|
||||
&res->start, &res->end, &size, res->name);
|
||||
|
||||
list_for_each_entry(r, &res->children, sibling)
|
||||
__print_resources(r, indent + 1);
|
||||
|
|
|
@ -326,9 +326,9 @@ static int bootm_open_oftree(struct image_data *data)
|
|||
static void bootm_print_info(struct image_data *data)
|
||||
{
|
||||
if (data->os_res)
|
||||
printf("OS image is at " PRINTF_CONVERSION_RESOURCE "-" PRINTF_CONVERSION_RESOURCE "\n",
|
||||
data->os_res->start,
|
||||
data->os_res->end);
|
||||
printf("OS image is at %pa-%pa\n",
|
||||
&data->os_res->start,
|
||||
&data->os_res->end);
|
||||
else
|
||||
printf("OS image not yet relocated\n");
|
||||
|
||||
|
@ -343,9 +343,9 @@ static void bootm_print_info(struct image_data *data)
|
|||
printf(", multifile image %d", data->initrd_num);
|
||||
printf("\n");
|
||||
if (data->initrd_res)
|
||||
printf("initrd is at " PRINTF_CONVERSION_RESOURCE "-" PRINTF_CONVERSION_RESOURCE "\n",
|
||||
data->initrd_res->start,
|
||||
data->initrd_res->end);
|
||||
printf("initrd is at %pa-%pa\n",
|
||||
&data->initrd_res->start,
|
||||
&data->initrd_res->end);
|
||||
else
|
||||
printf("initrd image not yet relocated\n");
|
||||
}
|
||||
|
|
|
@ -354,10 +354,9 @@ static int uimage_sdram_flush(void *buf, unsigned int len)
|
|||
uimage_resource = request_sdram_region("uimage",
|
||||
start, size);
|
||||
if (!uimage_resource) {
|
||||
printf("unable to request SDRAM "
|
||||
PRINTF_CONVERSION_RESOURCE "-"
|
||||
PRINTF_CONVERSION_RESOURCE "\n",
|
||||
start, start + size - 1);
|
||||
resource_size_t prsize = start + size - 1;
|
||||
printf("unable to request SDRAM %pa - %pa\n",
|
||||
&start, &prsize);
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,6 +123,7 @@ struct device_d *of_platform_device_create(struct device_node *np,
|
|||
{
|
||||
struct device_d *dev;
|
||||
struct resource *res = NULL, temp_res;
|
||||
resource_size_t resinval;
|
||||
int i, j, ret, num_reg = 0, match;
|
||||
|
||||
if (!of_device_is_available(np))
|
||||
|
@ -183,9 +184,11 @@ struct device_d *of_platform_device_create(struct device_node *np,
|
|||
dev->num_resources = num_reg;
|
||||
of_device_make_bus_id(dev);
|
||||
|
||||
debug("%s: register device %s, io=" PRINTF_CONVERSION_RESOURCE "\n",
|
||||
resinval = (-1);
|
||||
|
||||
debug("%s: register device %s, io=%pa\n",
|
||||
__func__, dev_name(dev),
|
||||
(num_reg) ? dev->resource[0].start : (-1));
|
||||
(num_reg) ? &dev->resource[0].start : &resinval);
|
||||
|
||||
ret = platform_device_register(dev);
|
||||
if (!ret)
|
||||
|
|
|
@ -26,12 +26,6 @@ struct resource {
|
|||
struct list_head sibling;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PHYS_ADDR_T_64BIT
|
||||
#define PRINTF_CONVERSION_RESOURCE "0x%016llx"
|
||||
#else
|
||||
#define PRINTF_CONVERSION_RESOURCE "0x%08x"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IO resources have these defined flags.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue