MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / drivers / mmc / core / sysfs.c
blob030d9893b10a5c7a2cf6cf487b25b54fb874eca4
1 /*
2 * linux/drivers/mmc/core/sysfs.c
4 * Copyright (C) 2003 Russell King, All Rights Reserved.
5 * Copyright 2007 Pierre Ossman
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * MMC sysfs/driver model support.
13 #include <linux/device.h>
15 #include <linux/mmc/card.h>
17 #include "sysfs.h"
19 int mmc_add_attrs(struct mmc_card *card, struct device_attribute *attrs)
21 int error = 0;
22 int i;
24 #if 0 // add by Victor Yu. 12-02-2008
25 device_add(&card->dev);
26 #endif
27 for (i = 0; attr_name(attrs[i]); i++) {
28 error = device_create_file(&card->dev, &attrs[i]);
29 if (error) {
30 while (--i >= 0)
31 device_remove_file(&card->dev, &attrs[i]);
32 #if 0 // add by VIctor Yu. 12-02-2008
33 device_del(&card->dev);
34 #endif
35 break;
39 return error;
42 void mmc_remove_attrs(struct mmc_card *card, struct device_attribute *attrs)
44 int i;
46 for (i = 0; attr_name(attrs[i]); i++)
47 device_remove_file(&card->dev, &attrs[i]);
48 #if 0 // add by Victor Yu. 12-02-2008
49 device_del(&card->dev);
50 #endif