All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: linux-mtd@lists.infradead.org,
	David Woodhouse <dwmw2@infradead.org>,
	Igor Grinberg <grinberg@compulab.co.il>
Subject: Re: [PATCH v2 2/4] mtd: nand: convert printk() to pr_*()
Date: Wed, 22 Jun 2011 07:40:50 +0300	[thread overview]
Message-ID: <1308717655.18119.19.camel@sauron> (raw)
In-Reply-To: <BANLkTimh12AhqfE+Yx3Yi_m=NyUb34JoXA@mail.gmail.com>

On Mon, 2011-06-13 at 11:24 -0700, Brian Norris wrote:
> On Thu, Jun 9, 2011 at 9:03 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> > On Thu, 2011-06-09 at 09:00 -0700, Brian Norris wrote:
> >> On Thu, Jun 9, 2011 at 12:44 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> >> > Wait, and why are we using pr_* while it is better to use dbg_* ? :-)
> >>
> >> Just so we're on the same page...did you say "dbg_*" when you really
> >> meant "dev_*"?
> >
> > Yes, I meant dev_*
> >
> >> Anyway, the answer is: I'm mostly trying to do as little shakeup as
> >> possible, so "printk" could translate pretty directly to the "pr_*"
> >> with shorter code, etc. If it makes as much (or more) sense to have
> >> the device name on all the prints, then I can just as well do it that
> >> way.
> >
> > Yes, I think it makes much more sense to specify for which device (out
> > of possibly many!) this message belongs.
> 
> I've been testing some of the "dev_*" printing, and it seems as if our
> mtd_info structs never have fully initialized "device" fields (i.e.,
> mtd->dev.driver, mtd->dev.bus, mtd->dev.class, mtd->dev.init_name,
> etc. are never filled in with anything meaningful). That means that
> our dev_* messages do not have anything to work from and simply print
> " (null): " references before our strings instead of device
> driver/name information, for example:
> 
>  (null): ONFI flash detected

Ouch, good finding.

> I'm a little new to the Linux device model, so I'm not sure if it's
> safe and sensible to add lines to a driver's nand_probe function,
> like, for plat_nand.c:
> data->mtd.dev.driver = pdev->dev.driver;
> data->mtd.dev.init_name = dev_name(&pdev->dev);

I think so, I believe struct device was added to mtd by some non-MTD guy
to just make it complaint with one of interface changes which required
struct device. So please, go ahead and improve that a bit.

> Is there some better way to initialize these device values? Or should
> we scrap the whole dev_* thing since MTD doesn't match the device
> model well enough?

I think there is no reason why it would not match the model, so of
course fixing this is preferable...

-- 
Best Regards,
Artem Bityutskiy

  reply	other threads:[~2011-06-22  4:40 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07 23:01 [PATCH 0/4] debug, printk cleanup Brian Norris
2011-06-07 23:01 ` [PATCH 1/4] mtd: remove printk's for [kv][mz]alloc failures Brian Norris
2011-06-08 14:27   ` Artem Bityutskiy
2011-06-07 23:01 ` [PATCH 2/4] mtd: nand: convert printk() to pr_*() Brian Norris
2011-06-08 14:43   ` Artem Bityutskiy
2011-06-08 18:25     ` [PATCH v2 " Brian Norris
2011-06-09  6:40       ` Artem Bityutskiy
2011-06-09  6:53       ` Artem Bityutskiy
2011-06-09  6:59         ` Artem Bityutskiy
2011-06-09  7:44       ` Artem Bityutskiy
2011-06-09 16:00         ` Brian Norris
2011-06-09 16:03           ` Artem Bityutskiy
2011-06-13 18:24             ` Brian Norris
2011-06-22  4:40               ` Artem Bityutskiy [this message]
2011-06-22  9:12                 ` Dmitry Eremin-Solenikov
2011-07-06 18:51                   ` Brian Norris
2011-07-06 19:12                     ` Brian Norris
2011-07-06 19:47                       ` Dmitry Eremin-Solenikov
2011-07-06 19:59                         ` Brian Norris
2011-07-07  6:58                     ` Artem Bityutskiy
2011-07-07 17:00                       ` Brian Norris
2011-07-07 19:56                         ` Artem Bityutskiy
2011-07-08 16:06                           ` Brian Norris
2011-07-20  3:59                             ` Artem Bityutskiy
2011-07-07  7:01               ` Artem Bityutskiy
2011-07-07 17:01                 ` Brian Norris
2011-06-09  8:13       ` Artem Bityutskiy
2011-06-09 16:22         ` Brian Norris
2011-06-10 18:25           ` Brian Norris
2011-06-07 23:01 ` [PATCH 3/4] mtd: nand: replace DEBUG() with dev_dbg() Brian Norris
2011-06-08 14:44   ` Artem Bityutskiy
2011-06-08 18:27     ` [PATCH v2 " Brian Norris
2011-06-09  6:46       ` Artem Bityutskiy
2011-06-07 23:01 ` [PATCH 4/4] mtd: nand: define pr_fmt() to include __func__ in debug output Brian Norris
2011-06-08 14:47   ` Artem Bityutskiy
2011-06-08 18:23     ` Brian Norris
2011-06-08 18:28       ` [PATCH v2 " Brian Norris
2011-06-09  7:10         ` Artem Bityutskiy
2011-06-08 19:03       ` [PATCH " Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1308717655.18119.19.camel@sauron \
    --to=dedekind1@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=grinberg@compulab.co.il \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.