mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mikael Starvik" <mikael.starvik@axis.com>
To: "'Greg Kroah-Hartman'" <gregkh@suse.de>, <linux-kernel@vger.kernel.org>
Cc: "Mikael Starvik" <mikael.starvik@axis.com>,
	"'Kay Sievers'" <kay.sievers@vrfy.org>
Subject: RE: [PATCH 128/196] Kobject: the cris iop_fw_load.c code is broken
Date: Fri, 25 Jan 2008 09:01:56 +0100	[thread overview]
Message-ID: <BFECAF9E178F144FAEF2BF4CE739C66804C403BB@exmail1.se.axis.com> (raw)
In-Reply-To: <BFECAF9E178F144FAEF2BF4CE739C6680595315C@exmail1.se.axis.com>

Yes, we are currently in the process of cleaning this up for all our device
drivers.
Thanks!

-----Original Message-----
From: Greg Kroah-Hartman [mailto:gregkh@suse.de] 
Sent: Friday, January 25, 2008 8:33 AM
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman; Mikael Starvik; Kay Sievers
Subject: [PATCH 128/196] Kobject: the cris iop_fw_load.c code is broken


This code is really really really broken.  So much so that it's almost
impossible to fix with a simple patch, so just comment out the offending
registration with the kobject core, and mark the driver as broken.

The problem is that the code is trying to register a "raw" struct
device, which is not allowed.  struct device is only for use within the
driver model.  This is being done to try to use the firmware layer which
wants a struct device.  To properly fix this, use something easy, like a
platform device, which is a struct device and can be used for this kind
of thing.

Cc: Mikael Starvik <starvik@axis.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/cris/arch-v32/drivers/iop_fw_load.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/cris/arch-v32/drivers/iop_fw_load.c
b/arch/cris/arch-v32/drivers/iop_fw_load.c
index 11f9895..f4bdc1d 100644
--- a/arch/cris/arch-v32/drivers/iop_fw_load.c
+++ b/arch/cris/arch-v32/drivers/iop_fw_load.c
@@ -20,6 +20,9 @@
 
 #define IOP_TIMEOUT 100
 
+#error "This driver is broken with regard to its driver core usage."
+#error "Please contact <greg@kroah.com> for details on how to fix it
properly."
+
 static struct device iop_spu_device[2] = {
 	{ .bus_id =     "iop-spu0", },
 	{ .bus_id =     "iop-spu1", },
@@ -192,6 +195,13 @@ int iop_start_mpu(unsigned int start_addr)
 
 static int __init iop_fw_load_init(void)
 {
+#if 0
+	/*
+	 * static struct devices can not be added directly to sysfs by
ignoring
+	 * the driver model infrastructure.  To fix this properly, please
use
+	 * the platform_bus to register these devices to be able to properly
+	 * use the firmware infrastructure.
+	 */
 	device_initialize(&iop_spu_device[0]);
 	kobject_set_name(&iop_spu_device[0].kobj, "iop-spu0");
 	kobject_add(&iop_spu_device[0].kobj);
@@ -201,6 +211,7 @@ static int __init iop_fw_load_init(void)
 	device_initialize(&iop_mpu_device);
 	kobject_set_name(&iop_mpu_device.kobj, "iop-mpu");
 	kobject_add(&iop_mpu_device.kobj);
+#endif
 	return 0;
 }
 
-- 
1.5.3.8


       reply	other threads:[~2008-01-25  8:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BFECAF9E178F144FAEF2BF4CE739C6680595315C@exmail1.se.axis.com>
2008-01-25  8:01 ` Mikael Starvik [this message]
2008-01-25  7:11 [GIT PATCH] driver core patches against 2.6.24 Greg KH
2008-01-25  7:32 ` [PATCH 128/196] Kobject: the cris iop_fw_load.c code is broken Greg Kroah-Hartman

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=BFECAF9E178F144FAEF2BF4CE739C66804C403BB@exmail1.se.axis.com \
    --to=mikael.starvik@axis.com \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®