mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Linus Walleij <linus.walleij@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Anmar Oueja <anmar.oueja@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Felipe Balbi <balbi@ti.com>, Benoit Cousson <b-cousson@ti.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Mitch Bradley <wmb@firmworks.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	Rickard Andersson <rickard.andersson@stericsson.com>
Subject: Re: [PATCH v3] drivers/pinctrl: grab default handles from device core
Date: Fri, 18 Jan 2013 20:13:07 +0000	[thread overview]
Message-ID: <20130118201307.GG23505@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1358521728-14300-1-git-send-email-linus.walleij@stericsson.com>

On Fri, Jan 18, 2013 at 04:08:48PM +0100, Linus Walleij wrote:
> - Abstain from using IS_ERR_OR_NULL() in the driver core,
>   Russell recently sent a patch to remove it. Handle the
>   NULL case explicitly even though it's a bogus case.

Hmmmmmmmm... I assume you're talking about this:

> +	p = create_pinctrl(dev);
> +	if (p && !IS_ERR(p))
> +		kref_init(&p->users);
> +	return p;

which is... interesting.  In mainline currently, the version I see there
never returns NULL - it either returns an err pointer or a real pointer.

Next thing though is...

create_pinctrl adds the struct pinctrl onto the global list, and then you
intialize it here, which is an interesting sequence.  It's safe at the
moment because everything here is operating under a mutex, but it's a
little obscure.

Is there a reason not to initialize p->users inside create_pinctrl() ?

  reply	other threads:[~2013-01-18 20:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-18 15:08 Linus Walleij
2013-01-18 20:13 ` Russell King - ARM Linux [this message]
2013-01-21 19:13   ` Linus Walleij

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=20130118201307.GG23505@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=anmar.oueja@linaro.org \
    --cc=b-cousson@ti.com \
    --cc=balbi@ti.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=rickard.andersson@stericsson.com \
    --cc=rjw@sisk.pl \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wmb@firmworks.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®