ANDROID: serdev: restrict claim of platform devices

Make the fallback path for claiming platform devices trigger only if a
new module parameter is specified:

  serdev_ttyport.pdev_tty_port=ttyS2

Bug: 146517987
Change-Id: Ibf331ad6e6d8712a405921530f217f7122428b13
Signed-off-by: Alistair Delva <adelva@google.com>
This commit is contained in:
Alistair Delva
2020-03-04 12:03:23 -08:00
parent 8af3a47b0a
commit 1f441a86a6
3 changed files with 47 additions and 8 deletions

View File

@@ -173,9 +173,21 @@ int serdev_device_add(struct serdev_device *);
void serdev_device_remove(struct serdev_device *);
struct serdev_controller *serdev_controller_alloc(struct device *, size_t);
int serdev_controller_add(struct serdev_controller *);
int serdev_controller_add_platform(struct serdev_controller *, bool);
void serdev_controller_remove(struct serdev_controller *);
/**
* serdev_controller_add() - Add an serdev controller
* @ctrl: controller to be registered.
*
* Register a controller previously allocated via serdev_controller_alloc() with
* the serdev core.
*/
static inline int serdev_controller_add(struct serdev_controller *ctrl)
{
return serdev_controller_add_platform(ctrl, false);
}
static inline void serdev_controller_write_wakeup(struct serdev_controller *ctrl)
{
struct serdev_device *serdev = ctrl->serdev;