Skip to contentSkip to conversation

Adding dummy release functions to avoid warnings.

PATCH Superseded Vitaliy Ivanov 3 participants 5 messages Apr 16, 2008 – Jun 5, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Adding dummy release functions to avoid warnings.

Subject: [PATCH] Adding dummy release functions to avoid warnings.

From: Vitaliy Ivanov <[email protected]>

Trivial fix for #9690.
Added simple release functions that doing nothing.
Not sure whether we can leave it as is or to rework using platform_device helpers like platform_device_alloc. This approach is used in many drivers.

--

 drivers/mtd/maps/physmap.c |    6 ++++++
 drivers/video/hgafb.c      |   10 +++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)
drivers/mtd/maps/physmap.c +6 -0
index bc4649a..5bdbd04 100644
@@ -264,11 +264,17 @@ static struct resource physmap_flash_resource = {
 	.flags		= IORESOURCE_MEM,
 };
 
+/* Fake release func.*/
+static void physmap_flash_release(struct device *dev)
+{
+}
+
 static struct platform_device physmap_flash = {
 	.name		= "physmap-flash",
 	.id		= 0,
 	.dev		= {
 		.platform_data	= &physmap_flash_data,
+		.release	= physmap_flash_release, 
 	},
 	.num_resources	= 1,
 	.resource	= &physmap_flash_resource,
drivers/video/hgafb.c +9 -1
index fb9e672..8707115 100644
@@ -623,8 +623,16 @@ static struct device_driver hgafb_driver = {
 	.remove = hgafb_remove,
 };
 
+/* Fake release func.*/
+static void hgafb_device_release(struct device *dev)
+{
+}
+
 static struct platform_device hgafb_device = {
-	.name = "hgafb",
+	.name	= "hgafb",
+	.dev	= {
+		.release = hgafb_device_release, 
+	},
 };
 
 static int __init hgafb_init(void)
#1 lore raw

PATCH RESEND 1/1 Adding dummy release functions to avoid warnings.

Hi all,

Natalie reported that patch wasn't accepted.
Please check this out. If I need to correct it somehow then pls let me know.

V.

---------- Forwarded message ----------
From: Vitaliy Ivanov <[email protected]>
Date: Wed, Apr 16, 2008 at 3:34 AM
Subject: [PATCH] Adding dummy release functions to avoid warnings.
To: [email protected], [email protected], [email protected], [email protected]

Subject: [PATCH] Adding dummy release functions to avoid warnings.

From: Vitaliy Ivanov <[email protected]>

Trivial fix for #9690.
Added simple release functions that doing nothing. Not sure whether we can leave it as is or to rework using platform_device helpers like platform_device_alloc. This approach is used in many drivers.

--

 drivers/mtd/maps/physmap.c |    6 ++++++
 drivers/video/hgafb.c      |   10 +++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)
drivers/mtd/maps/physmap.c +6 -0
index bc4649a..5bdbd04 100644
@@ -264,11 +264,17 @@ static struct resource physmap_flash_resource = {
       .flags          = IORESOURCE_MEM,
 };
 
+/* Fake release func.*/
+static void physmap_flash_release(struct device *dev)
+{
+}
+
 static struct platform_device physmap_flash = {
       .name           = "physmap-flash",
       .id             = 0,
       .dev            = {
               .platform_data  = &physmap_flash_data,
+               .release        = physmap_flash_release,
       },
       .num_resources  = 1,
       .resource       = &physmap_flash_resource,
drivers/video/hgafb.c +9 -1
index fb9e672..8707115 100644
@@ -623,8 +623,16 @@ static struct device_driver hgafb_driver = {
       .remove = hgafb_remove,
 };
 
+/* Fake release func.*/
+static void hgafb_device_release(struct device *dev)
+{
+}
+
 static struct platform_device hgafb_device = {
-       .name = "hgafb",
+       .name   = "hgafb",
+       .dev    = {
+               .release = hgafb_device_release,
+       },
 };
 
 static int __init hgafb_init(void)
#2 lore raw
Quoted 16 lines · On Thu, 5 Jun 2008 12:39:46 +0300 "Vitaliy Ivanov" <[email protected]>…

Hi all,

Natalie reported that patch wasn't accepted.
Please check this out. If I need to correct it somehow then pls let me know.

V.

---------- Forwarded message ----------
From: Vitaliy Ivanov <[email protected]>
Date: Wed, Apr 16, 2008 at 3:34 AM
Subject: [PATCH] Adding dummy release functions to avoid warnings.
To: [email protected], [email protected], [email protected], [email protected]

Quoted 8 lines

Subject: [PATCH] Adding dummy release functions to avoid warnings.

From: Vitaliy Ivanov <[email protected]>

Trivial fix for #9690.
Added simple release functions that doing nothing. Not sure whether we can leave it as is or to rework using platform_device helpers like platform_device_alloc.

Please see Documentation/kobject.txt - search for the text "mocked mercilessly" :)

Quoted 4 lines

This approach is used in many drivers.
--

 drivers/mtd/maps/physmap.c |    6 ++++++

Let's mock David too!

Quoted 1 line
 drivers/video/hgafb.c      |   10 +++++++++-

I expect that hgafb-convert-to-new-platform-driver-api-bugzilla-9689.patch which I merged yesterday will help here.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

#3 lore raw
Quoted 7 lines · Andrew Morton

Please see Documentation/kobject.txt - search for the text "mocked mercilessly" :)

Quoted 2 lines
 drivers/mtd/maps/physmap.c |    6 ++++++

Let's mock David too!

Do not taunt Happy Fun Dave.

Signature · 1 line
dwmw2
#4 lore raw
In reply to Andrew Morton

Andrew,

Quoted 9 lines · Andrew Morton
Quoted 4 lines · On Thu, 5 Jun 2008 12:39:46 +0300 "Vitaliy Ivanov" <[email protected]>…

Trivial fix for #9690.
Added simple release functions that doing nothing. Not sure whether we can leave it as is or to rework using platform_device helpers like platform_device_alloc.

Please see Documentation/kobject.txt - search for the text "mocked mercilessly" :)

Quoted 6 lines
Quoted 4 lines

This approach is used in many drivers.
--

 drivers/mtd/maps/physmap.c |    6 ++++++

Let's mock David too!

Damn. I knew that everything is not so easy here;) Got it. Tnx.

But in such case there are _again_ many drivers that do implement such fake functions. Again is because when I tried to port some usb driver there were issues with locking that was not correct but many drivers worked exactly this incorrect way.

Anyway, tnx for clarifying this.

V.