/* * Copyright (C) 2013 Daniel Tang * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * Based off drivers/usb/chipidea/ci_hdrc_msm.c * */ #include #include #include #include #include "ci.h" static struct ci_hdrc_platform_data ci_hdrc_zevio_platdata = { .name = "ci_hdrc_zevio", .flags = CI_HDRC_REGS_SHARED | CI_HDRC_FORCE_FULLSPEED, .capoffset = DEF_CAPOFFSET, }; static int ci_hdrc_zevio_probe(struct platform_device *pdev) { struct platform_device *ci_pdev; dev_dbg(&pdev->dev, "ci_hdrc_zevio_probe\n"); ci_pdev = ci_hdrc_add_device(&pdev->dev, pdev->resource, pdev->num_resources, &ci_hdrc_zevio_platdata); if (IS_ERR(ci_pdev)) { dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n"); return PTR_ERR(ci_pdev); } platform_set_drvdata(pdev, ci_pdev); return 0; } static int ci_hdrc_zevio_remove(struct platform_device *pdev) { struct platform_device *ci_pdev = platform_get_drvdata(pdev); ci_hdrc_remove_device(ci_pdev); return 0; } static const struct of_device_id ci_hdrc_zevio_dt_ids[] = { { .compatible = "lsi,zevio-usb", }, { /* sentinel */ } }; static struct platform_driver ci_hdrc_zevio_driver = { .probe = ci_hdrc_zevio_probe, .remove = ci_hdrc_zevio_remove, .driver = { .name = "zevio_usb", .of_match_table = ci_hdrc_zevio_dt_ids, }, }; MODULE_DEVICE_TABLE(of, ci_hdrc_zevio_dt_ids); module_platform_driver(ci_hdrc_zevio_driver); MODULE_LICENSE("GPL v2"); efslogtreecommitdiff
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2017-01-24 15:18:46 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 16:26:14 -0800
commitf598f82e204ec0b17797caaf1b0311c52d43fb9a (patch)
tree20e0109db50c168a36df14af76b484eaf9b71836 /drivers/usb/dwc3/debug.h
parent4180c4c170a5a33b9987b314d248a9d572d89ab0 (diff)
romfs: use different way to generate fsid for BLOCK or MTD
Commit 8a59f5d25265 ("fs/romfs: return f_fsid for statfs(2)") generates a 64bit id from sb->s_bdev->bd_dev. This is only correct when romfs is defined with CONFIG_ROMFS_ON_BLOCK. If romfs is only defined with CONFIG_ROMFS_ON_MTD, sb->s_bdev is NULL, referencing sb->s_bdev->bd_dev will triger an oops. Richard Weinberger points out that when CONFIG_ROMFS_BACKED_BY_BOTH=y, both CONFIG_ROMFS_ON_BLOCK and CONFIG_ROMFS_ON_MTD are defined. Therefore when calling huge_encode_dev() to generate a 64bit id, I use the follow order to choose parameter, - CONFIG_ROMFS_ON_BLOCK defined use sb->s_bdev->bd_dev - CONFIG_ROMFS_ON_BLOCK undefined and CONFIG_ROMFS_ON_MTD defined use sb->s_dev when, - both CONFIG_ROMFS_ON_BLOCK and CONFIG_ROMFS_ON_MTD undefined leave id as 0 When CONFIG_ROMFS_ON_MTD is defined and sb->s_mtd is not NULL, sb->s_dev is set to a device ID generated by MTD_BLOCK_MAJOR and mtd index, otherwise sb->s_dev is 0. This is a try-best effort to generate a uniq file system ID, if all the above conditions are not meet, f_fsid of this romfs instance will be 0. Generally only one romfs can be built on single MTD block device, this method is enough to identify multiple romfs instances in a computer. Link: http://lkml.kernel.org/r/1482928596-115155-1-git-send-email-colyli@suse.de Signed-off-by: Coly Li <colyli@suse.de> Reported-by: Nong Li <nongli1031@gmail.com> Tested-by: Nong Li <nongli1031@gmail.com> Cc: Richard Weinberger <richard.weinberger@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/dwc3/debug.h')