forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[media] media-device: move PCI/USB helper functions from v4l2-mc
Those ancillary functions could be called even when compiled without V4L2 support, as warned by ktest build robot: All errors (new ones prefixed by >>): >> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb/dvb-usb.ko] undefined! >> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb-v2/dvb_usb_v2.ko] undefined! >> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/au0828/au0828.ko] undefined! Also, there's nothing there that are specific to V4L2. So, move those ancillary functions to MC core. No functional changes. Just function rename. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
- Loading branch information
Showing
11 changed files
with
141 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* Media Controller ancillary functions | ||
* | ||
* (c) 2016 Mauro Carvalho Chehab <[email protected]> | ||
* Copyright (c) 2016 Mauro Carvalho Chehab <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -15,83 +15,9 @@ | |
*/ | ||
|
||
#include <linux/module.h> | ||
#include <linux/pci.h> | ||
#include <linux/usb.h> | ||
#include <media/media-entity.h> | ||
#include <media/v4l2-mc.h> | ||
|
||
|
||
struct media_device *v4l2_mc_pci_media_device_init(struct pci_dev *pci_dev, | ||
const char *name) | ||
{ | ||
#ifdef CONFIG_PCI | ||
struct media_device *mdev; | ||
|
||
mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); | ||
if (!mdev) | ||
return NULL; | ||
|
||
mdev->dev = &pci_dev->dev; | ||
|
||
if (name) | ||
strlcpy(mdev->model, name, sizeof(mdev->model)); | ||
else | ||
strlcpy(mdev->model, pci_name(pci_dev), sizeof(mdev->model)); | ||
|
||
sprintf(mdev->bus_info, "PCI:%s", pci_name(pci_dev)); | ||
|
||
mdev->hw_revision = (pci_dev->subsystem_vendor << 16) | ||
| pci_dev->subsystem_device; | ||
|
||
mdev->driver_version = LINUX_VERSION_CODE; | ||
|
||
media_device_init(mdev); | ||
|
||
return mdev; | ||
#else | ||
return NULL; | ||
#endif | ||
} | ||
EXPORT_SYMBOL_GPL(v4l2_mc_pci_media_device_init); | ||
|
||
struct media_device *__v4l2_mc_usb_media_device_init(struct usb_device *udev, | ||
const char *board_name, | ||
const char *driver_name) | ||
{ | ||
#ifdef CONFIG_USB | ||
struct media_device *mdev; | ||
|
||
mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); | ||
if (!mdev) | ||
return NULL; | ||
|
||
mdev->dev = &udev->dev; | ||
|
||
if (driver_name) | ||
strlcpy(mdev->driver_name, driver_name, | ||
sizeof(mdev->driver_name)); | ||
|
||
if (board_name) | ||
strlcpy(mdev->model, board_name, sizeof(mdev->model)); | ||
else if (udev->product) | ||
strlcpy(mdev->model, udev->product, sizeof(mdev->model)); | ||
else | ||
strlcpy(mdev->model, "unknown model", sizeof(mdev->model)); | ||
if (udev->serial) | ||
strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial)); | ||
usb_make_path(udev, mdev->bus_info, sizeof(mdev->bus_info)); | ||
mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice); | ||
mdev->driver_version = LINUX_VERSION_CODE; | ||
|
||
media_device_init(mdev); | ||
|
||
return mdev; | ||
#else | ||
return NULL; | ||
#endif | ||
} | ||
EXPORT_SYMBOL_GPL(__v4l2_mc_usb_media_device_init); | ||
|
||
int v4l2_mc_create_media_graph(struct media_device *mdev) | ||
|
||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.