From: Ezequiel Garcia Subject: Re: [PATCH v4] mtd: ubi: Extend UBI layer debug/messaging capabilities Date: Tue, 14 Oct 2014 15:47:02 -0300 Message-ID: <20141014184702.GA12662@arch.hh.imgtec.org> References: <1413296037-22346-1-git-send-email-tlinder@codeaurora.org> <20141014143902.GA9768@arch.hh.imgtec.org> <1413299343.7906.103.camel@sauron.fi.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from top.free-electrons.com ([176.31.233.9]:56307 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754166AbaJNSsl (ORCPT ); Tue, 14 Oct 2014 14:48:41 -0400 Content-Disposition: inline In-Reply-To: <1413299343.7906.103.camel@sauron.fi.intel.com> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Artem Bityutskiy Cc: Tanya Brokhman , linux-mtd@lists.infradead.org, linux-arm-msm@vger.kernel.org, David Woodhouse , Brian Norris , Richard Weinberger , open list 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 hea= ders > > should be enough: > >=20 > > #define pr_fmt(fmt) "UBI: block:" fmt >=20 > Sinc ubiblock is a device, there should be a 'struct device' somewher= e, > so probably dev_printk() and other dev_*() printing functions would b= e a > better choice? >=20 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 defi= ned 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. --=20 Ezequiel Garc=EDa, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com