Commit d08ba0fd authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by David S. Miller

nfc: s3fwrn5: constify nci_ops

s3fwrn5 driver modifies static struct nci_ops only to set prop_ops.
Since prop_ops is build time constant with known size, it can be made
const.  This allows to removeo the function setting the prop_ops -
s3fwrn5_nci_get_prop_ops().
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b9c28286
...@@ -143,11 +143,13 @@ static int s3fwrn5_nci_post_setup(struct nci_dev *ndev) ...@@ -143,11 +143,13 @@ static int s3fwrn5_nci_post_setup(struct nci_dev *ndev)
return nci_core_init(info->ndev); return nci_core_init(info->ndev);
} }
static struct nci_ops s3fwrn5_nci_ops = { static const struct nci_ops s3fwrn5_nci_ops = {
.open = s3fwrn5_nci_open, .open = s3fwrn5_nci_open,
.close = s3fwrn5_nci_close, .close = s3fwrn5_nci_close,
.send = s3fwrn5_nci_send, .send = s3fwrn5_nci_send,
.post_setup = s3fwrn5_nci_post_setup, .post_setup = s3fwrn5_nci_post_setup,
.prop_ops = s3fwrn5_nci_prop_ops,
.n_prop_ops = ARRAY_SIZE(s3fwrn5_nci_prop_ops),
}; };
int s3fwrn5_probe(struct nci_dev **ndev, void *phy_id, struct device *pdev, int s3fwrn5_probe(struct nci_dev **ndev, void *phy_id, struct device *pdev,
...@@ -167,9 +169,6 @@ int s3fwrn5_probe(struct nci_dev **ndev, void *phy_id, struct device *pdev, ...@@ -167,9 +169,6 @@ int s3fwrn5_probe(struct nci_dev **ndev, void *phy_id, struct device *pdev,
s3fwrn5_set_mode(info, S3FWRN5_MODE_COLD); s3fwrn5_set_mode(info, S3FWRN5_MODE_COLD);
s3fwrn5_nci_get_prop_ops(&s3fwrn5_nci_ops.prop_ops,
&s3fwrn5_nci_ops.n_prop_ops);
info->ndev = nci_allocate_device(&s3fwrn5_nci_ops, info->ndev = nci_allocate_device(&s3fwrn5_nci_ops,
S3FWRN5_NFC_PROTOCOLS, 0, 0); S3FWRN5_NFC_PROTOCOLS, 0, 0);
if (!info->ndev) if (!info->ndev)
......
...@@ -20,7 +20,7 @@ static int s3fwrn5_nci_prop_rsp(struct nci_dev *ndev, struct sk_buff *skb) ...@@ -20,7 +20,7 @@ static int s3fwrn5_nci_prop_rsp(struct nci_dev *ndev, struct sk_buff *skb)
return 0; return 0;
} }
static struct nci_driver_ops s3fwrn5_nci_prop_ops[] = { struct nci_driver_ops s3fwrn5_nci_prop_ops[4] = {
{ {
.opcode = nci_opcode_pack(NCI_GID_PROPRIETARY, .opcode = nci_opcode_pack(NCI_GID_PROPRIETARY,
NCI_PROP_SET_RFREG), NCI_PROP_SET_RFREG),
...@@ -43,12 +43,6 @@ static struct nci_driver_ops s3fwrn5_nci_prop_ops[] = { ...@@ -43,12 +43,6 @@ static struct nci_driver_ops s3fwrn5_nci_prop_ops[] = {
}, },
}; };
void s3fwrn5_nci_get_prop_ops(struct nci_driver_ops **ops, size_t *n)
{
*ops = s3fwrn5_nci_prop_ops;
*n = ARRAY_SIZE(s3fwrn5_nci_prop_ops);
}
#define S3FWRN5_RFREG_SECTION_SIZE 252 #define S3FWRN5_RFREG_SECTION_SIZE 252
int s3fwrn5_nci_rf_configure(struct s3fwrn5_info *info, const char *fw_name) int s3fwrn5_nci_rf_configure(struct s3fwrn5_info *info, const char *fw_name)
......
...@@ -50,7 +50,7 @@ struct nci_prop_fw_cfg_rsp { ...@@ -50,7 +50,7 @@ struct nci_prop_fw_cfg_rsp {
__u8 status; __u8 status;
}; };
void s3fwrn5_nci_get_prop_ops(struct nci_driver_ops **ops, size_t *n); extern struct nci_driver_ops s3fwrn5_nci_prop_ops[4];
int s3fwrn5_nci_rf_configure(struct s3fwrn5_info *info, const char *fw_name); int s3fwrn5_nci_rf_configure(struct s3fwrn5_info *info, const char *fw_name);
#endif /* __LOCAL_S3FWRN5_NCI_H_ */ #endif /* __LOCAL_S3FWRN5_NCI_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment