Commit 0e804326 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'nfc-const'



Krzysztof Kozlowski says:

====================
nfc: constify data structures

Constify pointers to several data structures which are not modified by
NFC core or by drivers to make it slightly safer.  No functional impact
expected.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c5381154 7186aac9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ xmit_from_hci():
The llc must be registered with nfc before it can be used. Do that by
calling::

	nfc_llc_register(const char *name, struct nfc_llc_ops *ops);
	nfc_llc_register(const char *name, const struct nfc_llc_ops *ops);

Again, note that the llc does not handle the physical link. It is thus very
easy to mix any physical link with any llc for a given chip driver.
+6 −5
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@
#define NCI_OP_PROP_SET_PDATA_OID		0x23

struct fdp_nci_info {
	struct nfc_phy_ops *phy_ops;
	const struct nfc_phy_ops *phy_ops;
	struct fdp_i2c_phy *phy;
	struct nci_dev *ndev;

@@ -651,7 +651,7 @@ static int fdp_nci_core_get_config_rsp_packet(struct nci_dev *ndev,
	return 0;
}

static struct nci_driver_ops fdp_core_ops[] = {
static const struct nci_driver_ops fdp_core_ops[] = {
	{
		.opcode = NCI_OP_CORE_GET_CONFIG_RSP,
		.rsp = fdp_nci_core_get_config_rsp_packet,
@@ -662,7 +662,7 @@ static struct nci_driver_ops fdp_core_ops[] = {
	},
};

static struct nci_driver_ops fdp_prop_ops[] = {
static const struct nci_driver_ops fdp_prop_ops[] = {
	{
		.opcode = nci_opcode_pack(NCI_GID_PROP, NCI_OP_PROP_PATCH_OID),
		.rsp = fdp_nci_prop_patch_rsp_packet,
@@ -675,7 +675,7 @@ static struct nci_driver_ops fdp_prop_ops[] = {
	},
};

static struct nci_ops nci_ops = {
static const struct nci_ops nci_ops = {
	.open = fdp_nci_open,
	.close = fdp_nci_close,
	.send = fdp_nci_send,
@@ -687,7 +687,7 @@ static struct nci_ops nci_ops = {
	.n_core_ops = ARRAY_SIZE(fdp_core_ops),
};

int fdp_nci_probe(struct fdp_i2c_phy *phy, struct nfc_phy_ops *phy_ops,
int fdp_nci_probe(struct fdp_i2c_phy *phy, const struct nfc_phy_ops *phy_ops,
			struct nci_dev **ndevp, int tx_headroom,
			int tx_tailroom, u8 clock_type, u32 clock_freq,
			u8 *fw_vsc_cfg)
@@ -718,6 +718,7 @@ int fdp_nci_probe(struct fdp_i2c_phy *phy, struct nfc_phy_ops *phy_ops,
		    NFC_PROTO_NFC_DEP_MASK |
		    NFC_PROTO_ISO15693_MASK;

	BUILD_BUG_ON(ARRAY_SIZE(fdp_prop_ops) > NCI_MAX_PROPRIETARY_CMD);
	ndev = nci_allocate_device(&nci_ops, protocols, tx_headroom,
				   tx_tailroom);
	if (!ndev) {
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ struct fdp_i2c_phy {
	uint16_t next_read_size;
};

int fdp_nci_probe(struct fdp_i2c_phy *phy, struct nfc_phy_ops *phy_ops,
int fdp_nci_probe(struct fdp_i2c_phy *phy, const struct nfc_phy_ops *phy_ops,
		  struct nci_dev **ndev, int tx_headroom, int tx_tailroom,
		  u8 clock_type, u32 clock_freq, u8 *fw_vsc_cfg);
void fdp_nci_remove(struct nci_dev *ndev);
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ static int fdp_nci_i2c_write(void *phy_id, struct sk_buff *skb)
	return r;
}

static struct nfc_phy_ops i2c_phy_ops = {
static const struct nfc_phy_ops i2c_phy_ops = {
	.write = fdp_nci_i2c_write,
	.enable = fdp_nci_i2c_enable,
	.disable = fdp_nci_i2c_disable,
+1 −1
Original line number Diff line number Diff line
@@ -362,7 +362,7 @@ static void nfc_mei_phy_disable(void *phy_id)
	phy->powered = 0;
}

struct nfc_phy_ops mei_phy_ops = {
const struct nfc_phy_ops mei_phy_ops = {
	.write = nfc_mei_phy_write,
	.enable = nfc_mei_phy_enable,
	.disable = nfc_mei_phy_disable,
Loading