X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=include%2Flinux%2Fmcb.h;h=4097ac9ea13accda06500a7605a4ca8a3632112f;hb=0fb3ca447ddabcfb8dc7e0f719955e500b170cbd;hp=ead13d233a97e60392110d0b8bba43c3b7fa5e5a;hpb=2605b98109100f70398115a473ea190ce93fda5e;p=cascardo%2Flinux.git diff --git a/include/linux/mcb.h b/include/linux/mcb.h index ead13d233a97..4097ac9ea13a 100644 --- a/include/linux/mcb.h +++ b/include/linux/mcb.h @@ -41,15 +41,17 @@ struct mcb_bus { char name[CHAMELEON_FILENAME_LEN + 1]; int (*get_irq)(struct mcb_device *dev); }; -#define to_mcb_bus(b) container_of((b), struct mcb_bus, dev) + +static inline struct mcb_bus *to_mcb_bus(struct device *dev) +{ + return container_of(dev, struct mcb_bus, dev); +} /** * struct mcb_device - MEN Chameleon Bus device * - * @bus_list: internal list handling for bus code * @dev: device in kernel representation * @bus: mcb bus the device is plugged to - * @subordinate: subordinate MCBus in case of bridge * @is_added: flag to check if device is added to bus * @driver: associated mcb_driver * @id: mcb device id @@ -62,10 +64,8 @@ struct mcb_bus { * @memory: memory resource */ struct mcb_device { - struct list_head bus_list; struct device dev; struct mcb_bus *bus; - struct mcb_bus *subordinate; bool is_added; struct mcb_driver *driver; u16 id; @@ -76,8 +76,13 @@ struct mcb_device { int rev; struct resource irq; struct resource mem; + struct device *dma_dev; }; -#define to_mcb_device(x) container_of((x), struct mcb_device, dev) + +static inline struct mcb_device *to_mcb_device(struct device *dev) +{ + return container_of(dev, struct mcb_device, dev); +} /** * struct mcb_driver - MEN Chameleon Bus device driver @@ -95,7 +100,11 @@ struct mcb_driver { void (*remove)(struct mcb_device *mdev); void (*shutdown)(struct mcb_device *mdev); }; -#define to_mcb_driver(x) container_of((x), struct mcb_driver, driver) + +static inline struct mcb_driver *to_mcb_driver(struct device_driver *drv) +{ + return container_of(drv, struct mcb_driver, driver); +} static inline void *mcb_get_drvdata(struct mcb_device *dev) {