]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtlwifi: Constify rtl_hal_cfg.{ops,usb_interface_cfg} and rtl_priv.cfg
authorBitterblue Smith <rtl8821cerfe2@gmail.com>
Thu, 23 May 2024 14:48:02 +0000 (17:48 +0300)
committerPing-Ke Shih <pkshih@realtek.com>
Thu, 30 May 2024 02:28:39 +0000 (10:28 +0800)
This allows the drivers to declare the structs rtl_hal_cfg, rtl_hal_ops,
and rtl_hal_usbint_cfg as const.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/1b29994f-3d07-4297-875d-57c3a87a1ec6@gmail.com
drivers/net/wireless/realtek/rtlwifi/base.c
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c
drivers/net/wireless/realtek/rtlwifi/usb.c
drivers/net/wireless/realtek/rtlwifi/usb.h
drivers/net/wireless/realtek/rtlwifi/wifi.h

index 1a8d715b7c07099357e699d380c382a839c83918..aab4605de9c47c0078b9e0199fc85a50a8b4ae02 100644 (file)
@@ -2272,7 +2272,7 @@ static void rtl_c2h_content_parsing(struct ieee80211_hw *hw,
                                    struct sk_buff *skb)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
-       struct rtl_hal_ops *hal_ops = rtlpriv->cfg->ops;
+       const struct rtl_hal_ops *hal_ops = rtlpriv->cfg->ops;
        const struct rtl_btc_ops *btc_ops = rtlpriv->btcoexist.btc_ops;
        u8 cmd_id, cmd_len;
        u8 *cmd_buf = NULL;
index 48be7e346efcc1ad613fda7cc06195050af5abbc..c9b9e2bc90cc49cb6131f31a3101bdf299abe8fa 100644 (file)
@@ -53,8 +53,6 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
        } else {
                fw_name = "rtlwifi/rtl8192cufw_TMSC.bin";
        }
-       /* provide name of alternative file */
-       rtlpriv->cfg->alt_fw_name = "rtlwifi/rtl8192cufw.bin";
        pr_info("Loading firmware %s\n", fw_name);
        rtlpriv->max_fw_size = 0x4000;
        err = request_firmware_nowait(THIS_MODULE, 1,
@@ -160,6 +158,7 @@ static struct rtl_hal_usbint_cfg rtl92cu_interface_cfg = {
 
 static struct rtl_hal_cfg rtl92cu_hal_cfg = {
        .name = "rtl92c_usb",
+       .alt_fw_name = "rtlwifi/rtl8192cufw.bin",
        .ops = &rtl8192cu_hal_ops,
        .mod_params = &rtl92cu_mod_params,
        .usb_interface_cfg = &rtl92cu_interface_cfg,
index 2ea72d9e39577ede7b763f78aa9d1e3f468c7aa5..b6d300bec1e9dafce61d662aa89773007247087f 100644 (file)
@@ -937,7 +937,7 @@ static const struct rtl_intf_ops rtl_usb_ops = {
 
 int rtl_usb_probe(struct usb_interface *intf,
                  const struct usb_device_id *id,
-                 struct rtl_hal_cfg *rtl_hal_cfg)
+                 const struct rtl_hal_cfg *rtl_hal_cfg)
 {
        int err;
        struct ieee80211_hw *hw = NULL;
index 12529afc0510b623d01ad3f8e7b4662256266304..b66d6f9ae564eb4826b8ec21ed96b78e76399cdb 100644 (file)
@@ -136,7 +136,7 @@ struct rtl_usb_priv {
 
 int rtl_usb_probe(struct usb_interface *intf,
                  const struct usb_device_id *id,
-                 struct rtl_hal_cfg *rtl92cu_hal_cfg);
+                 const struct rtl_hal_cfg *rtl92cu_hal_cfg);
 void rtl_usb_disconnect(struct usb_interface *intf);
 int rtl_usb_suspend(struct usb_interface *pusb_intf, pm_message_t message);
 int rtl_usb_resume(struct usb_interface *pusb_intf);
index 6a8212fd36af6a22ac0e01ca63db1dd4c335f9fb..ae6e351bc83c9158256696cd2f301fece689cf01 100644 (file)
@@ -2356,9 +2356,9 @@ struct rtl_hal_cfg {
        bool write_readback;
        char *name;
        char *alt_fw_name;
-       struct rtl_hal_ops *ops;
+       const struct rtl_hal_ops *ops;
        struct rtl_mod_params *mod_params;
-       struct rtl_hal_usbint_cfg *usb_interface_cfg;
+       const struct rtl_hal_usbint_cfg *usb_interface_cfg;
        enum rtl_spec_ver spec_ver;
 
        /*this map used for some registers or vars
@@ -2707,7 +2707,7 @@ struct rtl_priv {
        /* hal_cfg : for diff cards
         * intf_ops : for diff interrface usb/pcie
         */
-       struct rtl_hal_cfg *cfg;
+       const struct rtl_hal_cfg *cfg;
        const struct rtl_intf_ops *intf_ops;
 
        /* this var will be set by set_bit,