slimbus: Add API to get matching ID table

Add API in slimbus driver for clients to get the
matching ID table which helps in accessing driver
data and name fields.

CRs-fixed: 975738
Change-Id: I09c9f1de74e348b032d215cbb0fb9ba6c7aecf18
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
This commit is contained in:
Phani Kumar Uppalapati 2016-05-04 10:33:42 -07:00 committed by Jeevan Shriram
parent f0795bea15
commit c9ef6d3852
2 changed files with 12 additions and 1 deletions

View file

@ -62,6 +62,14 @@ static const struct slim_device_id *slim_match(const struct slim_device_id *id,
return NULL;
}
const struct slim_device_id *slim_get_device_id(const struct slim_device *sdev)
{
const struct slim_driver *sdrv = to_slim_driver(sdev->dev.driver);
return slim_match(sdrv->id_table, sdev);
}
EXPORT_SYMBOL(slim_get_device_id);
static int slim_device_match(struct device *dev, struct device_driver *driver)
{
struct slim_device *slim_dev;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -1173,6 +1173,9 @@ extern struct slim_controller *slim_busnum_to_ctrl(u32 busnum);
*/
extern void slim_ctrl_add_boarddevs(struct slim_controller *ctrl);
extern const
struct slim_device_id *slim_get_device_id(const struct slim_device *sdev);
/*
* slim_register_board_info: Board-initialization routine.
* @info: List of all devices on all controllers present on the board.