diff mbox

Enable module aliases for vio on sparc/sparc64

Message ID 570ED4BD.8060805@physik.fu-berlin.de
State Superseded
Delegated to: David Miller
Headers show

Commit Message

John Paul Adrian Glaubitz April 13, 2016, 11:22 p.m. UTC
On 04/14/2016 01:04 AM, John Paul Adrian Glaubitz wrote:
> Testing a much simpler version now. Second.

Attaching two patches which add modalias_show and vio_hotplug. With
the patches applied, module autoloading works as expected.

Going to bed now, it's past midnight here.

Adrian

Comments

David Miller April 14, 2016, 1:52 a.m. UTC | #1
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Thu, 14 Apr 2016 01:22:37 +0200

> From 3515ad550f7b1db467664acc9bf0ed3d2aec9fdd Mon Sep 17 00:00:00 2001
> From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Date: Thu, 14 Apr 2016 01:19:40 +0200
> Subject: [PATCH 2/2] sparc/kernel/vio.c: implement vio_hotplug and add it to
>  vio_bus_type
> 
> Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> ---
>  arch/sparc/kernel/vio.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
> index 5a9bb9d..59f4b7c 100644
> --- a/arch/sparc/kernel/vio.c
> +++ b/arch/sparc/kernel/vio.c
> @@ -45,6 +45,13 @@ static const struct vio_device_id *vio_match_device(
>  	return NULL;
>  }
>  
> +static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
> +{
> +	const struct vio_dev *vio_dev = to_vio_dev(dev);
> +	add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, vio_dev->compat);
> +	 return 0;

Extra space before "return 0" after the TAB.

Need an empty line after the local variable declarations.

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller April 14, 2016, 1:53 a.m. UTC | #2
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Thu, 14 Apr 2016 01:22:37 +0200

> From 8d95bce6a35dc037d1e419896af19e12b3cda910 Mon Sep 17 00:00:00 2001
> From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Date: Thu, 14 Apr 2016 01:16:14 +0200
> Subject: [PATCH 1/2] sparc/kernel/vio.c: implement modalias_show()
> 
> Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> ---
>  arch/sparc/kernel/vio.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
> index cb5789c..5a9bb9d 100644
> --- a/arch/sparc/kernel/vio.c
> +++ b/arch/sparc/kernel/vio.c
> @@ -105,6 +105,13 @@ static ssize_t type_show(struct device *dev,
>  	return sprintf(buf, "%s\n", vdev->type);
>  }
>  
> +static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
> +                             char *buf)
> +{
> +	const struct vio_dev *vdev = to_vio_dev(dev);
> +	return sprintf(buf, "vio:T%sS%s\n", vdev->type, vdev->compat);
> +}
> +

You're not hooking this function up at all into the operations.  Looks like
you are mixing this patch up with other local changes.

And again, please, empty line after local variable declarations.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

From 8d95bce6a35dc037d1e419896af19e12b3cda910 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Thu, 14 Apr 2016 01:16:14 +0200
Subject: [PATCH 1/2] sparc/kernel/vio.c: implement modalias_show()

Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
---
 arch/sparc/kernel/vio.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index cb5789c..5a9bb9d 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -105,6 +105,13 @@  static ssize_t type_show(struct device *dev,
 	return sprintf(buf, "%s\n", vdev->type);
 }
 
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+                             char *buf)
+{
+	const struct vio_dev *vdev = to_vio_dev(dev);
+	return sprintf(buf, "vio:T%sS%s\n", vdev->type, vdev->compat);
+}
+
 static struct device_attribute vio_dev_attrs[] = {
 	__ATTR_RO(devspec),
 	__ATTR_RO(type),
-- 
2.8.0.rc3