The patch titled

     mmc: conditional scr sysfs entry

has been added to the -mm tree.  Its filename is

     mmc-conditional-scr-sysfs-entry.patch

Patches currently in -mm which might be from [EMAIL PROTECTED] are

sd-initialize-sd-cards.patch
sd-read-only-switch.patch
sd-read-only-switch-coding-style-fix.patch
sd-read-only-switch-mmc-sd-init-order-fix.patch
sd-read-only-switch-mmc-sd-ro-style-fix.patch
sd-scr-register.patch
sd-scr-register-mmc-sd-scr-style-fixpatch.patch
sd-scr-in-sysfs.patch
sd-4-bit-bus.patch
sd-copyright-notice.patch
mmc-conditional-scr-sysfs-entry.patch
mmc-multi-sector-writes.patch



From: Pierre Ossman <[EMAIL PROTECTED]>

Only show the scr file in sysfs for SD cards.  Previously this was present
for all cards but had a contents of 0 for MMC cards.

Signed-off-by: Pierre Ossman <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/mmc/mmc_sysfs.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/mmc_sysfs.c~mmc-conditional-scr-sysfs-entry 
drivers/mmc/mmc_sysfs.c
--- devel/drivers/mmc/mmc_sysfs.c~mmc-conditional-scr-sysfs-entry       
2005-08-30 17:09:57.000000000 -0700
+++ devel-akpm/drivers/mmc/mmc_sysfs.c  2005-08-30 17:10:27.000000000 -0700
@@ -48,7 +48,6 @@ MMC_ATTR(serial, "0x%08x\n", card->cid.s
 static struct device_attribute mmc_dev_attrs[] = {
        MMC_ATTR_RO(cid),
        MMC_ATTR_RO(csd),
-       MMC_ATTR_RO(scr),
        MMC_ATTR_RO(date),
        MMC_ATTR_RO(fwrev),
        MMC_ATTR_RO(hwrev),
@@ -59,6 +58,8 @@ static struct device_attribute mmc_dev_a
        __ATTR_NULL
 };
 
+static struct device_attribute mmc_dev_attr_scr = MMC_ATTR_RO(scr);
+
 
 static void mmc_release_card(struct device *dev)
 {
@@ -209,10 +210,20 @@ void mmc_init_card(struct mmc_card *card
  */
 int mmc_register_card(struct mmc_card *card)
 {
+       int ret;
+
        snprintf(card->dev.bus_id, sizeof(card->dev.bus_id),
                 "%s:%04x", mmc_hostname(card->host), card->rca);
 
-       return device_add(&card->dev);
+       ret = device_add(&card->dev);
+       if (ret == 0) {
+               if (mmc_card_sd(card)) {
+                       ret = device_create_file(&card->dev, &mmc_dev_attr_scr);
+                       if (ret)
+                               device_del(&card->dev);
+               }
+       }
+       return ret;
 }
 
 /*
@@ -221,8 +232,12 @@ int mmc_register_card(struct mmc_card *c
  */
 void mmc_remove_card(struct mmc_card *card)
 {
-       if (mmc_card_present(card))
+       if (mmc_card_present(card)) {
+               if (mmc_card_sd(card))
+                       device_remove_file(&card->dev, &mmc_dev_attr_scr);
+
                device_del(&card->dev);
+       }
 
        put_device(&card->dev);
 }
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to