Re: [PATCH v4] mtd: ubi: Extend UBI layer debug/messaging capabilities

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14 Oct 06:09 PM, Artem Bityutskiy wrote:
> On Tue, 2014-10-14 at 11:39 -0300, Ezequiel Garcia wrote:
> > Please use some pr_fmt for this. Something like this before the headers
> > should be enough:
> > 
> > #define pr_fmt(fmt) "UBI: block:" fmt
> 
> Sinc ubiblock is a device, there should be a 'struct device' somewhere,
> so probably dev_printk() and other dev_*() printing functions would be a
> better choice?
> 

A quick code dig shows you should get the struct device associated
to the struct gendisk, with the disk_to_dev() macro.

In other words, something like this should work, provided 'dev' is defined
in the scope as a struct ubiblock:

  #define ubiblock_err(x) dev_err(disk_to_dev(dev->gd), x)

When the gendisk is not available, a simple pr_{} would work.
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux