bus.h 934 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * linux/drivers/mmc/core/bus.h
  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. #ifndef _MMC_CORE_BUS_H
  12. #define _MMC_CORE_BUS_H
  13. #define MMC_DEV_ATTR(name, fmt, args...) \
  14. static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \
  15. { \
  16. struct mmc_card *card = mmc_dev_to_card(dev); \
  17. return sprintf(buf, fmt, args); \
  18. } \
  19. static DEVICE_ATTR(name, S_IRUGO, mmc_##name##_show, NULL)
  20. struct mmc_card *mmc_alloc_card(struct mmc_host *host,
  21. struct device_type *type);
  22. int mmc_add_card(struct mmc_card *card);
  23. void mmc_remove_card(struct mmc_card *card);
  24. int mmc_register_bus(void);
  25. void mmc_unregister_bus(void);
  26. #endif