devinfo: make the output of "devinfo DEVICE" nicer
* some output sections started with "foo: bar", some with "foo = bar". Unify this. * there was a fixed size to the "foo =" parameters, which wasn't fitting, this was especially visible at "devinfo global" * don't output "resources:", "driver:" and "bus:" lines if there are none resources, drivers or busses involved. * remove some empty lines * harmonize differentiation between headlines (e.g. "resources:") and values by indenting values slightly * uppercase some texts Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
c19c0da71c
commit
287c03267e
|
@ -51,16 +51,16 @@ static int do_devinfo_subtree(struct device_d *dev, int depth)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int do_devinfo(int argc, char *argv[])
|
static int do_devinfo(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct device_d *dev;
|
struct device_d *dev;
|
||||||
struct param_d *param;
|
struct param_d *param;
|
||||||
int i;
|
int i;
|
||||||
|
int first;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
printf("devices:\n");
|
|
||||||
|
|
||||||
for_each_device(dev) {
|
for_each_device(dev) {
|
||||||
if (!dev->parent)
|
if (!dev->parent)
|
||||||
do_devinfo_subtree(dev, 0);
|
do_devinfo_subtree(dev, 0);
|
||||||
|
@ -73,38 +73,42 @@ static int do_devinfo(int argc, char *argv[])
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("resources:\n");
|
if (dev->num_resources)
|
||||||
|
printf("Resources:\n");
|
||||||
for (i = 0; i < dev->num_resources; i++) {
|
for (i = 0; i < dev->num_resources; i++) {
|
||||||
res = &dev->resource[i];
|
res = &dev->resource[i];
|
||||||
printf(" num: %d\n", i);
|
printf(" num: %d\n", i);
|
||||||
if (res->name)
|
if (res->name)
|
||||||
printf(" name: %s\n", res->name);
|
printf(" name: %s\n", res->name);
|
||||||
printf("start : " PRINTF_CONVERSION_RESOURCE "\nsize : "
|
printf(" start: " PRINTF_CONVERSION_RESOURCE "\n"
|
||||||
PRINTF_CONVERSION_RESOURCE "\n",
|
" size: " PRINTF_CONVERSION_RESOURCE "\n",
|
||||||
res->start, resource_size(res));
|
res->start, resource_size(res));
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("driver: %s\n", dev->driver ?
|
if (dev->driver)
|
||||||
dev->driver->name : "none");
|
printf("Driver: %s\n", dev->driver->name);
|
||||||
|
|
||||||
printf("bus: %s\n\n", dev->bus ?
|
if (dev->bus)
|
||||||
dev->bus->name : "none");
|
printf("Bus: %s\n", dev->bus->name);
|
||||||
|
|
||||||
if (dev->info)
|
if (dev->info)
|
||||||
dev->info(dev);
|
dev->info(dev);
|
||||||
|
|
||||||
printf("%s\n", list_empty(&dev->parameters) ?
|
first = true;
|
||||||
"no parameters available" : "Parameters:");
|
|
||||||
|
|
||||||
list_for_each_entry(param, &dev->parameters, list) {
|
list_for_each_entry(param, &dev->parameters, list) {
|
||||||
printf("%16s = %s", param->name, dev_get_param(dev, param->name));
|
if (first) {
|
||||||
if (param->info)
|
printf("Parameters:\n");
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
printf(" %s: %s", param->name, dev_get_param(dev, param->name));
|
||||||
|
if (param->info) {
|
||||||
param->info(param);
|
param->info(param);
|
||||||
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_OFDEVICE
|
#ifdef CONFIG_OFDEVICE
|
||||||
if (dev->device_node) {
|
if (dev->device_node) {
|
||||||
printf("\ndevice node: %s\n", dev->device_node->full_name);
|
printf("Device node: %s\n", dev->device_node->full_name);
|
||||||
of_print_nodes(dev->device_node, 0);
|
of_print_nodes(dev->device_node, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -125,7 +125,7 @@ static struct file_operations fb_ops = {
|
||||||
|
|
||||||
static void fb_print_mode(struct fb_videomode *mode)
|
static void fb_print_mode(struct fb_videomode *mode)
|
||||||
{
|
{
|
||||||
printf("%-20s %dx%d@%d\n", mode->name,
|
printf(" %s: %dx%d@%d\n", mode->name,
|
||||||
mode->xres, mode->yres, mode->refresh);
|
mode->xres, mode->yres, mode->refresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,12 +141,9 @@ static void fb_info(struct device_d *dev)
|
||||||
{
|
{
|
||||||
struct fb_info *info = dev->priv;
|
struct fb_info *info = dev->priv;
|
||||||
|
|
||||||
printf("available modes:\n");
|
printf("Available modes:\n");
|
||||||
|
|
||||||
fb_print_modes(&info->modes);
|
fb_print_modes(&info->modes);
|
||||||
fb_print_modes(&info->edid_modes);
|
fb_print_modes(&info->edid_modes);
|
||||||
|
|
||||||
printf("\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int register_framebuffer(struct fb_info *info)
|
int register_framebuffer(struct fb_info *info)
|
||||||
|
|
Loading…
Reference in New Issue