Fixing a bug in team driver due to incorrect 'unsigned int' to 'int' conversion
[cascardo/linux.git] / include / linux / mcb.h
index ead13d2..4097ac9 100644 (file)
@@ -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)
 {