/* Platform device IDs are assumed to be encoded like this: "<name><instance>", where <name> is a short description of the type of device, like "pci" or "floppy", and <instance> is the enumerated instance of the device, like '0' or '42'. Driver IDs are simply "<name>". So, extract the <name> from the platform_device structure, and compare it against the name of the driver. Return whether they match or not.  */
static int platform_match(struct device *dev, struct device_driver *drv)
/* Platform device IDs are assumed to be encoded like this: "<name><instance>", where <name> is a short description of the type of device, like "pci" or "floppy", and <instance> is the enumerated instance of the device, like '0' or '42'. Driver IDs are simply "<name>". So, extract the <name> from the platform_device structure, and compare it against the name of the driver. Return whether they match or not.  */
static int platform_match(struct device *dev, struct device_driver *drv)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct platform_driver *pdrv = to_platform_driver(drv);
	if (pdrv->id_table)
		return platform_match_id(pdrv->id_table, pdev) != NULL;
	return (strcmp(pdev->name, drv->name) == 0);
}