if (add_uevent_var(env, "TIFM_CARD_TYPE=%s", tifm_media_type_name(sock->type, 1)))
#include <linux/module.h>
#define DRIVER_NAME "tifm_core"
#define DRIVER_VERSION "0.8"
static struct workqueue_struct *workqueue;
static DEFINE_IDR(tifm_adapter_idr);
static DEFINE_SPINLOCK(tifm_adapter_lock);
static const char *tifm_media_type_name(unsigned char type, unsigned char nt)
const char *card_type_name[3][3] = {
{ "SmartMedia/xD", "MemoryStick", "MMC/SD" },
if (nt > 2 || type < 1 || type > 3)
return card_type_name[nt][type - 1];
static int tifm_dev_match(struct tifm_dev *sock, struct tifm_device_id *id)
if (sock->type == id->type)
static int tifm_bus_match(struct device *dev, struct device_driver *drv)
struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev);
struct tifm_driver *fm_drv = container_of(drv, struct tifm_driver,
struct tifm_device_id *ids = fm_drv->id_table;
if (tifm_dev_match(sock, ids))
static int tifm_uevent(struct device *dev, struct kobj_uevent_env *env)