OpenCores
URL https://opencores.org/ocsvn/test_project/test_project/trunk

Subversion Repositories test_project

[/] [test_project/] [trunk/] [linux_sd_driver/] [drivers/] [mmc/] [core/] [sysfs.c] - Blame information for rev 62

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 62 marcus.erl
/*
2
 *  linux/drivers/mmc/core/sysfs.c
3
 *
4
 *  Copyright (C) 2003 Russell King, All Rights Reserved.
5
 *  Copyright 2007 Pierre Ossman
6
 *
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.
10
 *
11
 *  MMC sysfs/driver model support.
12
 */
13
#include <linux/device.h>
14
 
15
#include <linux/mmc/card.h>
16
 
17
#include "sysfs.h"
18
 
19
int mmc_add_attrs(struct mmc_card *card, struct device_attribute *attrs)
20
{
21
        int error = 0;
22
        int i;
23
 
24
        for (i = 0; attr_name(attrs[i]); i++) {
25
                error = device_create_file(&card->dev, &attrs[i]);
26
                if (error) {
27
                        while (--i >= 0)
28
                                device_remove_file(&card->dev, &attrs[i]);
29
                        break;
30
                }
31
        }
32
 
33
        return error;
34
}
35
 
36
void mmc_remove_attrs(struct mmc_card *card, struct device_attribute *attrs)
37
{
38
        int i;
39
 
40
        for (i = 0; attr_name(attrs[i]); i++)
41
                device_remove_file(&card->dev, &attrs[i]);
42
}
43
 

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.