[core] mark the configuration table as const
This commit is contained in:
parent
8ea3ae46fc
commit
d88aecfc00
|
@ -28,7 +28,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
#include "common.h"
|
||||
#include "compat.h"
|
||||
|
||||
int amd_common_probe(struct vendor_reset_cfg *cfg, struct pci_dev *dev)
|
||||
int amd_common_probe(const struct vendor_reset_cfg *cfg, struct pci_dev *dev)
|
||||
{
|
||||
/* disable bus reset for the card, seems to be an issue with all of them */
|
||||
dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET;
|
||||
|
|
|
@ -123,7 +123,7 @@ static inline struct amd_vendor_private *amd_private(struct vendor_reset_dev *vd
|
|||
return vdev->vendor_private;
|
||||
}
|
||||
|
||||
int amd_common_probe(struct vendor_reset_cfg *cfg, struct pci_dev *dev);
|
||||
int amd_common_probe(const struct vendor_reset_cfg *cfg, struct pci_dev *dev);
|
||||
int amd_common_pre_reset(struct vendor_reset_dev *);
|
||||
int amd_common_post_reset(struct vendor_reset_dev *);
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
{PCI_VENDOR_ID_ATI, 0x7360, op, DEVICE_INFO(AMD_NAVI12)}, \
|
||||
{PCI_VENDOR_ID_ATI, 0x7362, op, DEVICE_INFO(AMD_NAVI12)}
|
||||
|
||||
static struct vendor_reset_cfg vendor_reset_devices[] = {
|
||||
static const struct vendor_reset_cfg vendor_reset_devices[] = {
|
||||
_AMD_POLARIS10(&amd_polaris10_ops),
|
||||
_AMD_POLARIS11(&amd_polaris10_ops),
|
||||
_AMD_POLARIS12(&amd_polaris10_ops),
|
||||
|
|
|
@ -32,7 +32,7 @@ static int (*orig_pci_dev_specific_reset)(struct pci_dev *dev, int probe);
|
|||
static int hooked_pci_dev_specific_reset(struct pci_dev *dev, int probe)
|
||||
{
|
||||
int ret;
|
||||
struct vendor_reset_cfg *cfg;
|
||||
const struct vendor_reset_cfg *cfg;
|
||||
|
||||
cfg = vendor_reset_cfg_find(dev->vendor, dev->device);
|
||||
if (!cfg)
|
||||
|
|
|
@ -27,7 +27,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
static long vendor_reset_ioctl_reset(struct file * filp, unsigned long arg)
|
||||
{
|
||||
struct vendor_reset_ioctl iodev;
|
||||
struct vendor_reset_cfg *cfg;
|
||||
const struct vendor_reset_cfg *cfg;
|
||||
struct pci_dev * dev;
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
#include "vendor-reset-dev.h"
|
||||
#include "device-db.h"
|
||||
|
||||
struct vendor_reset_cfg * vendor_reset_cfg_find(unsigned int vendor,
|
||||
const struct vendor_reset_cfg * vendor_reset_cfg_find(unsigned int vendor,
|
||||
unsigned int device)
|
||||
{
|
||||
struct vendor_reset_cfg * cfg;
|
||||
const struct vendor_reset_cfg * cfg;
|
||||
|
||||
for(cfg = vendor_reset_devices; cfg->vendor; ++cfg)
|
||||
{
|
||||
|
@ -40,7 +40,8 @@ struct vendor_reset_cfg * vendor_reset_cfg_find(unsigned int vendor,
|
|||
return cfg;
|
||||
}
|
||||
|
||||
long vendor_reset_dev_locked(struct vendor_reset_cfg *cfg, struct pci_dev *dev)
|
||||
long vendor_reset_dev_locked(const struct vendor_reset_cfg *cfg,
|
||||
struct pci_dev *dev)
|
||||
{
|
||||
struct vendor_reset_dev vdev =
|
||||
{
|
||||
|
@ -78,7 +79,8 @@ long vendor_reset_dev_locked(struct vendor_reset_cfg *cfg, struct pci_dev *dev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
long vendor_reset_dev(struct vendor_reset_cfg *cfg, struct pci_dev *dev)
|
||||
long vendor_reset_dev(const struct vendor_reset_cfg *cfg,
|
||||
struct pci_dev *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ struct vendor_reset_cfg;
|
|||
|
||||
struct vendor_reset_dev
|
||||
{
|
||||
struct vendor_reset_cfg *cfg;
|
||||
const struct vendor_reset_cfg *cfg;
|
||||
struct pci_dev *pdev;
|
||||
unsigned long info;
|
||||
|
||||
|
@ -46,7 +46,7 @@ struct vendor_reset_ops
|
|||
/* version of the reset operations for logging */
|
||||
const struct vendor_reset_ver version;
|
||||
/* called when the kernel is probing for a working reset function */
|
||||
int (*probe)(struct vendor_reset_cfg *, struct pci_dev *);
|
||||
int (*probe)(const struct vendor_reset_cfg *, struct pci_dev *);
|
||||
/* any pre-reset ops to do, i.e., common code between devices */
|
||||
int (*pre_reset)(struct vendor_reset_dev *);
|
||||
/* the reset method for the device at the specified address */
|
||||
|
@ -74,12 +74,13 @@ struct vendor_reset_cfg
|
|||
};
|
||||
|
||||
/* search the device table for the specified vendor and device id and return it */
|
||||
struct vendor_reset_cfg * vendor_reset_cfg_find(unsigned int vendor,
|
||||
const struct vendor_reset_cfg * vendor_reset_cfg_find(unsigned int vendor,
|
||||
unsigned int device);
|
||||
|
||||
/* perform the device reset */
|
||||
long vendor_reset_dev_locked(struct vendor_reset_cfg *cfg, struct pci_dev *dev);
|
||||
long vendor_reset_dev(struct vendor_reset_cfg *cfg, struct pci_dev *dev);
|
||||
long vendor_reset_dev_locked(const struct vendor_reset_cfg *cfg,
|
||||
struct pci_dev *dev);
|
||||
long vendor_reset_dev(const struct vendor_reset_cfg *cfg, struct pci_dev *dev);
|
||||
|
||||
#define vr_info(vdev, fmt, arg...) \
|
||||
pci_info ((vdev)->pdev, "%s: " fmt, (vdev)->cfg->info_str, ##arg)
|
||||
|
|
Loading…
Reference in New Issue