这里要重点关注其 match()成员函数,正是此成员函数确定了 platform_device 和 platform_driver之间如何匹配:
static int platform_match(struct device *dev, struct device_driver *drv) { struct platform_device *pdev; pdev = container_of(dev, struct platform_device, dev); return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0); }

