linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel@daenzer.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ben Hutchings <ben@decadent.org.uk>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: therm_pm72 units, interface
Date: Mon, 05 Aug 2013 11:13:13 +0200	[thread overview]
Message-ID: <1375693993.3852.143.camel@thor.local> (raw)
In-Reply-To: <1375477360.15999.19.camel@pasglop>

On Sam, 2013-08-03 at 07:02 +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2013-08-02 at 18:52 +0200, Michel D=C3=A4nzer wrote:
>=20
> > Thanks for the suggestion. The same windfarm modules were loaded in bot=
h
> > cases, but i2c_powermac wasn't loaded with the newer kernels. Loading i=
t
> > manually fixes the problem.
> >=20
> > How is i2c_powermac supposed to get loaded with current kernels?
>=20
> It's a platform driver, but it's missing a module device-table
>=20
> Can you try this completely untested patch ?
>=20
> diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-p=
owermac.c
> index 8dc90da..5af5153 100644
> --- a/drivers/i2c/busses/i2c-powermac.c
> +++ b/drivers/i2c/busses/i2c-powermac.c
> @@ -458,9 +458,15 @@ static int i2c_powermac_probe(struct platform_device=
 *dev)
>  	return rc;
>  }
> =20
> +static const struct platform_device_id i2c_powermac_id =3D {
> +	.name =3D "i2c-powermac"
> +};
> +MODULE_DEVICE_TABLE(platform, i2c_powermac_id);
> +
>  static struct platform_driver i2c_powermac_driver =3D {
>  	.probe =3D i2c_powermac_probe,
>  	.remove =3D i2c_powermac_remove,
> +	.id_table =3D *i2c_powermac_id,

This fails to build:

  CC [M]  drivers/i2c/busses/i2c-powermac.o
drivers/i2c/busses/i2c-powermac.c:469:14: error: invalid type argument of u=
nary =E2=80=98*=E2=80=99 (have =E2=80=98const struct platform_device_id=E2=
=80=99)
make[1]: *** [drivers/i2c/busses/i2c-powermac.o] Error 1

The version below builds, but the module still doesn't get loaded
automagically (unless I'm missing some command I need to run between
copying the new module to /lib/modules/$(uname -r)/ and rebooting?).

Looking at other drivers in drivers/i2c/busses/, maybe
i2c_powermac_driver.driver needs an of_match_table entry?


diff --git a/drivers/i2c/busses/i2c-powermac.c
b/drivers/i2c/busses/i2c-powermac.c
index 8dc90da..74066fc 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -458,9 +458,19 @@ static int i2c_powermac_probe(struct
platform_device *dev)
        return rc;
 }

+static const struct platform_device_id i2c_powermac_id[] =3D {
+       {
+               .name =3D "i2c-powermac"
+       }, {
+               /* sentinel */
+       }
+};
+MODULE_DEVICE_TABLE(platform, i2c_powermac_id);
+
 static struct platform_driver i2c_powermac_driver =3D {
        .probe =3D i2c_powermac_probe,
        .remove =3D i2c_powermac_remove,
+       .id_table =3D i2c_powermac_id,
        .driver =3D {
                .name =3D "i2c-powermac",
                .bus =3D &platform_bus_type,
@@ -468,5 +478,3 @@ static struct platform_driver i2c_powermac_driver =3D
{
 };

 module_platform_driver(i2c_powermac_driver);
-
-MODULE_ALIAS("platform:i2c-powermac");

--=20
Earthling Michel D=C3=A4nzer           |                   http://www.amd.c=
om
Libre software enthusiast         |          Debian, X and DRI developer

  reply	other threads:[~2013-08-05  9:13 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-15 17:53 therm_pm72 units, interface Jan Engelhardt
2012-08-15 21:35 ` Benjamin Herrenschmidt
2012-08-16 15:24   ` Jan Engelhardt
2012-08-16 20:51     ` Benjamin Herrenschmidt
2012-08-17 13:51       ` Jan Engelhardt
2012-08-17 20:17         ` Benjamin Herrenschmidt
2012-08-17 14:23       ` Jan Engelhardt
2012-08-15 21:36 ` Benjamin Herrenschmidt
2013-01-17 14:38   ` Jan Engelhardt
2013-01-17 23:38     ` Benjamin Herrenschmidt
2013-07-19 17:43       ` Aaro Koskinen
2013-07-19 23:16         ` Benjamin Herrenschmidt
2013-07-20 20:33           ` Aaro Koskinen
2013-07-20 23:42             ` Benjamin Herrenschmidt
2013-08-02 10:03             ` Michel Dänzer
2013-08-02 12:51               ` Benjamin Herrenschmidt
2013-08-02 14:47                 ` Michel Dänzer
2013-08-02 15:58                   ` Aaro Koskinen
2013-08-02 16:52                     ` Michel Dänzer
2013-08-02 21:02                       ` Benjamin Herrenschmidt
2013-08-05  9:13                         ` Michel Dänzer [this message]
2013-08-05  9:22                           ` Benjamin Herrenschmidt
2013-08-05 10:32                             ` Michel Dänzer
2013-08-05 10:53                               ` Benjamin Herrenschmidt
2013-09-27 15:44                                 ` Michel Dänzer
2013-08-02 20:47                   ` Benjamin Herrenschmidt
2013-08-02 20:56                     ` Ben Hutchings
2013-08-02 21:04                       ` Benjamin Herrenschmidt

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=1375693993.3852.143.camel@thor.local \
    --to=michel@daenzer.net \
    --cc=ben@decadent.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).