All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	linux-m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: [PATCH v2 4/4] zorro: Drop useless (and hardly used) .driver member in struct zorro_dev
Date: Mon, 9 Aug 2021 15:25:54 +0200	[thread overview]
Message-ID: <CAMuHMdU28k_eAaPoZ8Fzoxv-p=vT6jtuNmGkE79DsLc=-aeRhA@mail.gmail.com> (raw)
In-Reply-To: <20210730191035.1455248-5-u.kleine-koenig@pengutronix.de>

Hi Uwe,

On Fri, Jul 30, 2021 at 9:10 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> The only actual use is to check in zorro_device_probe() that the device
> isn't already bound. The driver core already ensures this however so the
> check can go away which allows to drop the then assigned-only member
> from struct zorro_dev.
>
> If the value was indeed needed somewhere it can always be calculated by
>
>         to_zorro_driver(z->dev.driver)
>
> .
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks for your patch!

> --- a/drivers/zorro/zorro-driver.c
> +++ b/drivers/zorro/zorro-driver.c
> @@ -47,16 +47,14 @@ static int zorro_device_probe(struct device *dev)
>         struct zorro_driver *drv = to_zorro_driver(dev->driver);
>         struct zorro_dev *z = to_zorro_dev(dev);
>
> -       if (!z->driver && drv->probe) {
> +       if (drv->probe) {
>                 const struct zorro_device_id *id;
>
>                 id = zorro_match_device(drv->id_table, z);
>                 if (id)
>                         error = drv->probe(z, id);
> -               if (error >= 0) {
> -                       z->driver = drv;
> +               if (error >= 0)

I guess this test can become "> 0" now, but that doesn't matter much.

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

>                         error = 0;
> -               }
>         }
>         return error;
>  }

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

      reply	other threads:[~2021-08-09 13:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 19:10 [PATCH v2 0/4] Some cleanups after making bus_type::remove return void Uwe Kleine-König
2021-07-30 19:10 ` [PATCH v2 1/4] nubus: Simplify check in remove callback Uwe Kleine-König
2021-08-01  5:04   ` Finn Thain
2021-08-02  6:52     ` Uwe Kleine-König
2021-08-03  2:14       ` Finn Thain
2021-07-30 19:10 ` [PATCH v2 2/4] sh: superhyway: " Uwe Kleine-König
2021-07-30 19:10 ` [PATCH v2 3/4] zorro: Simplify " Uwe Kleine-König
2021-08-09 13:22   ` Geert Uytterhoeven
2021-07-30 19:10 ` [PATCH v2 4/4] zorro: Drop useless (and hardly used) .driver member in struct zorro_dev Uwe Kleine-König
2021-08-09 13:25   ` Geert Uytterhoeven [this message]

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='CAMuHMdU28k_eAaPoZ8Fzoxv-p=vT6jtuNmGkE79DsLc=-aeRhA@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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.