mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: Pierre Ossman <drzeus-mmc@drzeus.cx>
Cc: Andy Whitcroft <apw@canonical.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] mmc: add MODALIAS linkage for MMC/SD devices
Date: Mon, 23 Feb 2009 12:38:41 +0000	[thread overview]
Message-ID: <1235392721-22545-2-git-send-email-apw@canonical.com> (raw)
In-Reply-To: <20090218205654.05896ece@mjolnir.ossman.eu>

[Pierre, here is the updated version.  Got lost somewhere after testing
and before sending out.]

Currently we are using an explicit udev rule to trigger loading of the
mmc-block module when an MMC or SD card is detected:

    SUBSYSTEM=="mmc", RUN+="/sbin/modprobe -Qba mmc-block"

It makes much more sense for the mmc bus driver and the mmc-block module to
share MODALIAS information so that they are linked automatically.

There is no real information of use in the MMC system at the current time.
All devices inserted require us to load the mmc-block device.  Until such
time as useful parameters exist simply reflect the module linkage via
the module alias below:

	mmc:block

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 drivers/mmc/card/block.c |    2 ++
 drivers/mmc/core/bus.c   |    8 ++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 513eb09..fe8041e 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -41,6 +41,8 @@
 
 #include "queue.h"
 
+MODULE_ALIAS("mmc:block");
+
 /*
  * max 8 partitions per card
  */
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index f210a8e..bdb165f 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -84,6 +84,14 @@ mmc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 	}
 
 	retval = add_uevent_var(env, "MMC_NAME=%s", mmc_card_name(card));
+	if (retval)
+		return retval;
+
+	/*
+	 * Request the mmc_block device.  Note: that this is a direct request
+	 * for the module it carries no information as to what is inserted.
+	 */
+	retval = add_uevent_var(env, "MODALIAS=mmc:block");
 
 	return retval;
 }
-- 
1.6.1.2.419.g0d87e


  parent reply	other threads:[~2009-02-23 12:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090218205654.05896ece@mjolnir.ossman.eu>
2009-02-23 12:38 ` [PATCH 0/1] mmc-modalias-v2r1 Andy Whitcroft
2009-02-23 12:38 ` Andy Whitcroft [this message]
2009-03-02 21:10   ` [PATCH 1/1] mmc: add MODALIAS linkage for MMC/SD devices Pierre Ossman
2009-01-06 18:56 Andy Whitcroft
2009-01-12 15:05 ` Pierre Ossman
2009-01-15 15:00   ` Andy Whitcroft
2009-01-24 17:56     ` Pierre Ossman
2009-01-24 23:45       ` Kay Sievers
2009-01-25 15:48         ` Pierre Ossman
2009-01-25 16:00           ` Kay Sievers
2009-01-26  9:35             ` Andy Whitcroft
2009-01-27 12:12               ` Andy Whitcroft
2009-01-27 19:14             ` Pierre Ossman
2009-01-27 19:26               ` Kay Sievers
2009-01-28 15:06                 ` Andy Whitcroft
2009-01-28 19:58                   ` Pierre Ossman

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=1235392721-22545-2-git-send-email-apw@canonical.com \
    --to=apw@canonical.com \
    --cc=akpm@linux-foundation.org \
    --cc=drzeus-mmc@drzeus.cx \
    --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®