--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
-@@ -15,37 +15,37 @@ drm-y := drm_auth.o drm_buffer.o d
+@@ -15,38 +15,38 @@ drm-y := drm_auth.o drm_buffer.o d
drm_trace_points.o drm_global.o drm_prime.o
drm-$(CONFIG_COMPAT) += drm_ioc32.o
drm-usb-y := drm_usb.o
- drm_kms_helper-y := drm_fb_helper.o drm_crtc_helper.o drm_dp_i2c_helper.o
+ drm_kms_helper-y := drm_fb_helper.o drm_crtc_helper.o drm_dp_helper.o
-drm_kms_helper-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
-drm_kms_helper-$(CONFIG_DRM_KMS_CMA_HELPER) += drm_fb_cma_helper.o
+drm_kms_helper-$(CONFIG_COMPAT_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
-obj-$(CONFIG_DRM_UDL) += udl/
-obj-$(CONFIG_DRM_AST) += ast/
-obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/
+-obj-$(CONFIG_DRM_TEGRA) += tegra/
+obj-$(CONFIG_COMPAT_DRM) += drm.o
+obj-$(CONFIG_COMPAT_DRM_USB) += drm_usb.o
+obj-$(CONFIG_COMPAT_DRM_TTM) += ttm/
+obj-$(CONFIG_COMPAT_DRM_UDL) += udl/
+obj-$(CONFIG_COMPAT_DRM_AST) += ast/
+obj-$(CONFIG_COMPAT_DRM_SHMOBILE) +=shmobile/
++obj-$(CONFIG_COMPAT_DRM_TEGRA) += tegra/
obj-y += i2c/
--- a/drivers/gpu/drm/ast/Makefile
+++ b/drivers/gpu/drm/ast/Makefile
+obj-$(CONFIG_COMPAT_DRM_CIRRUS_QEMU) += cirrus.o
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
-@@ -119,7 +119,7 @@ int drm_helper_probe_single_connector_mo
+@@ -142,7 +142,7 @@ int drm_helper_probe_single_connector_mo
goto prune;
}
MODULE_DEVICE_TABLE(pci, pciidlist);
#endif
-@@ -431,7 +431,7 @@ static int __init radeon_init(void)
+@@ -440,7 +440,7 @@ static int __init radeon_init(void)
#endif
/* if enabled by default */
if (radeon_modeset == -1) {
+obj-$(CONFIG_COMPAT_DRM_VIA) +=via.o
--- a/drivers/gpu/drm/vmwgfx/Makefile
+++ b/drivers/gpu/drm/vmwgfx/Makefile
-@@ -7,4 +7,4 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.
- vmwgfx_overlay.o vmwgfx_marker.o vmwgfx_gmrid_manager.o \
- vmwgfx_fence.o vmwgfx_dmabuf.o vmwgfx_scrn.o
+@@ -8,4 +8,4 @@ vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.
+ vmwgfx_fence.o vmwgfx_dmabuf.o vmwgfx_scrn.o vmwgfx_context.o \
+ vmwgfx_surface.o
-obj-$(CONFIG_DRM_VMWGFX) := vmwgfx.o
+obj-$(CONFIG_COMPAT_DRM_VMWGFX) := vmwgfx.o
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
-@@ -1632,10 +1632,10 @@ static int hwsim_register_received_nl(st
+@@ -1925,10 +1925,10 @@ static int hwsim_register_received_nl(st
if (info == NULL)
goto out;
return 0;
out:
-@@ -1672,7 +1672,7 @@ static int mac80211_hwsim_netlink_notify
+@@ -1965,7 +1965,7 @@ static int mac80211_hwsim_netlink_notify
if (state != NETLINK_URELEASE)
return NOTIFY_DONE;
wmediumd_portid = 0;
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -1276,7 +1276,7 @@ static int nl80211_dump_wiphy(struct sk_
+@@ -1282,7 +1282,7 @@ static int nl80211_dump_wiphy(struct sk_
continue;
if (++idx <= start)
continue;
cb->nlh->nlmsg_seq, NLM_F_MULTI,
dev) < 0) {
idx--;
-@@ -1299,7 +1299,7 @@ static int nl80211_get_wiphy(struct sk_b
+@@ -1305,7 +1305,7 @@ static int nl80211_get_wiphy(struct sk_b
if (!msg)
return -ENOMEM;
nlmsg_free(msg);
return -ENOBUFS;
}
-@@ -1814,7 +1814,7 @@ static int nl80211_dump_interface(struct
+@@ -1940,7 +1940,7 @@ static int nl80211_dump_interface(struct
if_idx++;
continue;
}
cb->nlh->nlmsg_seq, NLM_F_MULTI,
rdev, wdev) < 0) {
mutex_unlock(&rdev->devlist_mtx);
-@@ -1845,7 +1845,7 @@ static int nl80211_get_interface(struct
+@@ -1971,7 +1971,7 @@ static int nl80211_get_interface(struct
if (!msg)
return -ENOMEM;
dev, wdev) < 0) {
nlmsg_free(msg);
return -ENOBUFS;
-@@ -2063,7 +2063,7 @@ static int nl80211_new_interface(struct
+@@ -2189,7 +2189,7 @@ static int nl80211_new_interface(struct
break;
}
rdev, wdev) < 0) {
nlmsg_free(msg);
return -ENOBUFS;
-@@ -2198,7 +2198,7 @@ static int nl80211_get_key(struct sk_buf
+@@ -2324,7 +2324,7 @@ static int nl80211_get_key(struct sk_buf
if (!msg)
return -ENOMEM;
NL80211_CMD_NEW_KEY);
if (IS_ERR(hdr))
return PTR_ERR(hdr);
-@@ -2962,7 +2962,7 @@ static int nl80211_dump_station(struct s
+@@ -3100,7 +3100,7 @@ static int nl80211_dump_station(struct s
goto out_err;
if (nl80211_send_station(skb,
cb->nlh->nlmsg_seq, NLM_F_MULTI,
dev, netdev, mac_addr,
&sinfo) < 0)
-@@ -3008,7 +3008,7 @@ static int nl80211_get_station(struct sk
+@@ -3146,7 +3146,7 @@ static int nl80211_get_station(struct sk
if (!msg)
return -ENOMEM;
rdev, dev, mac_addr, &sinfo) < 0) {
nlmsg_free(msg);
return -ENOBUFS;
-@@ -3424,7 +3424,7 @@ static int nl80211_dump_mpath(struct sk_
+@@ -3562,7 +3562,7 @@ static int nl80211_dump_mpath(struct sk_
if (err)
goto out_err;
cb->nlh->nlmsg_seq, NLM_F_MULTI,
netdev, dst, next_hop,
&pinfo) < 0)
-@@ -3473,7 +3473,7 @@ static int nl80211_get_mpath(struct sk_b
+@@ -3611,7 +3611,7 @@ static int nl80211_get_mpath(struct sk_b
if (!msg)
return -ENOMEM;
dev, dst, next_hop, &pinfo) < 0) {
nlmsg_free(msg);
return -ENOBUFS;
-@@ -3713,7 +3713,7 @@ static int nl80211_get_mesh_config(struc
+@@ -3851,7 +3851,7 @@ static int nl80211_get_mesh_config(struc
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
return -ENOMEM;
NL80211_CMD_GET_MESH_CONFIG);
if (!hdr)
goto out;
-@@ -4031,7 +4031,7 @@ static int nl80211_get_reg(struct sk_buf
+@@ -4169,7 +4169,7 @@ static int nl80211_get_reg(struct sk_buf
goto out;
}
NL80211_CMD_GET_REG);
if (!hdr)
goto put_failure;
-@@ -4675,7 +4675,7 @@ static int nl80211_send_bss(struct sk_bu
+@@ -4813,7 +4813,7 @@ static int nl80211_send_bss(struct sk_bu
ASSERT_WDEV_LOCK(wdev);
NL80211_CMD_NEW_SCAN_RESULTS);
if (!hdr)
return -1;
-@@ -4894,7 +4894,7 @@ static int nl80211_dump_survey(struct sk
+@@ -5032,7 +5032,7 @@ static int nl80211_dump_survey(struct sk
}
if (nl80211_send_survey(skb,
cb->nlh->nlmsg_seq, NLM_F_MULTI,
netdev,
&survey) < 0)
-@@ -5527,7 +5527,7 @@ static int nl80211_testmode_dump(struct
+@@ -5677,7 +5677,7 @@ static int nl80211_testmode_dump(struct
}
while (1) {
cb->nlh->nlmsg_seq, NLM_F_MULTI,
NL80211_CMD_TESTMODE);
struct nlattr *tmdata;
-@@ -5606,7 +5606,7 @@ struct sk_buff *cfg80211_testmode_alloc_
+@@ -5756,7 +5756,7 @@ struct sk_buff *cfg80211_testmode_alloc_
return NULL;
return __cfg80211_testmode_alloc_skb(rdev, approxlen,
rdev->testmode_info->snd_seq,
GFP_KERNEL);
}
-@@ -5945,7 +5945,7 @@ static int nl80211_remain_on_channel(str
+@@ -6089,7 +6089,7 @@ static int nl80211_remain_on_channel(str
if (!msg)
return -ENOMEM;
NL80211_CMD_REMAIN_ON_CHANNEL);
if (IS_ERR(hdr)) {
-@@ -6164,7 +6164,7 @@ static int nl80211_register_mgmt(struct
+@@ -6308,7 +6308,7 @@ static int nl80211_register_mgmt(struct
if (!rdev->ops->mgmt_tx)
return -EOPNOTSUPP;
nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]),
nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH]));
}
-@@ -6245,7 +6245,7 @@ static int nl80211_tx_mgmt(struct sk_buf
+@@ -6378,7 +6378,7 @@ static int nl80211_tx_mgmt(struct sk_buf
if (!msg)
return -ENOMEM;
NL80211_CMD_FRAME);
if (IS_ERR(hdr)) {
-@@ -6361,7 +6361,7 @@ static int nl80211_get_power_save(struct
+@@ -6493,7 +6493,7 @@ static int nl80211_get_power_save(struct
if (!msg)
return -ENOMEM;
NL80211_CMD_GET_POWER_SAVE);
if (!hdr) {
err = -ENOBUFS;
-@@ -6561,7 +6561,7 @@ static int nl80211_get_wowlan(struct sk_
+@@ -6684,7 +6684,7 @@ static int nl80211_get_wowlan(struct sk_
if (!msg)
return -ENOMEM;
NL80211_CMD_GET_WOWLAN);
if (!hdr)
goto nla_put_failure;
-@@ -6838,7 +6838,7 @@ static int nl80211_register_unexpected_f
+@@ -6961,7 +6961,7 @@ static int nl80211_register_unexpected_f
if (wdev->ap_unexpected_nlportid)
return -EBUSY;
return 0;
}
-@@ -6868,7 +6868,7 @@ static int nl80211_probe_client(struct s
+@@ -6991,7 +6991,7 @@ static int nl80211_probe_client(struct s
if (!msg)
return -ENOMEM;
NL80211_CMD_PROBE_CLIENT);
if (IS_ERR(hdr)) {
-@@ -6906,7 +6906,7 @@ static int nl80211_register_beacons(stru
- if (rdev->ap_beacons_nlportid)
- return -EBUSY;
-
-- rdev->ap_beacons_nlportid = info->snd_portid;
-+ rdev->ap_beacons_nlportid = genl_info_snd_portid(info);
+@@ -7035,13 +7035,13 @@ static int nl80211_register_beacons(stru
+ /* First, check if already registered. */
+ spin_lock_bh(&rdev->beacon_registrations_lock);
+ list_for_each_entry(reg, &rdev->beacon_registrations, list) {
+- if (reg->nlportid == info->snd_portid) {
++ if (reg->nlportid == genl_info_snd_portid(info)) {
+ rv = -EALREADY;
+ goto out_err;
+ }
+ }
+ /* Add it to the list */
+- nreg->nlportid = info->snd_portid;
++ nreg->nlportid = genl_info_snd_portid(info);
+ list_add(&nreg->list, &rdev->beacon_registrations);
- return 0;
- }
-@@ -8970,8 +8970,8 @@ static int nl80211_netlink_notify(struct
+ spin_unlock_bh(&rdev->beacon_registrations_lock);
+@@ -9169,12 +9169,12 @@ static int nl80211_netlink_notify(struct
list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list) {
list_for_each_entry_rcu(wdev, &rdev->wdev_list, list)
- cfg80211_mlme_unregister_socket(wdev, notify->portid);
-- if (rdev->ap_beacons_nlportid == notify->portid)
+ cfg80211_mlme_unregister_socket(wdev, netlink_notify_portid(notify));
-+ if (rdev->ap_beacons_nlportid == netlink_notify_portid(notify))
- rdev->ap_beacons_nlportid = 0;
- }
+ spin_lock_bh(&rdev->beacon_registrations_lock);
+ list_for_each_entry_safe(reg, tmp, &rdev->beacon_registrations,
+ list) {
+- if (reg->nlportid == notify->portid) {
++ if (reg->nlportid == netlink_notify_portid(notify)) {
+ list_del(®->list);
+ kfree(reg);
+ break;
#include <linux/etherdevice.h>
#include <linux/sched.h>
#include <linux/firmware.h>
---- a/drivers/net/wireless/brcm80211/brcmsmac/dma.c
-+++ b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
-@@ -13,9 +13,10 @@
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
--
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-+#include <linux/printk.h>
- #include <linux/slab.h>
- #include <linux/delay.h>
- #include <linux/pci.h>
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -14,8 +14,10 @@
+#include <linux/printk.h>
#include <linux/types.h>
#include <linux/netdevice.h>
- #include <linux/sched.h>
+
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -15,8 +15,10 @@
+#undef pr_fmt
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- #include <linux/init.h>
#include <linux/kernel.h>
+ #include <linux/etherdevice.h>
+#include <linux/printk.h>
- #include <linux/kthread.h>
- #include <linux/slab.h>
- #include <linux/skbuff.h>
+ #include <linux/module.h>
+ #include <net/cfg80211.h>
+ #include <net/rtnetlink.h>
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
@@ -14,9 +14,11 @@
#include <linux/kernel.h>
+#include <linux/printk.h>
#include <linux/string.h>
- #include <linux/sched.h>
#include <linux/netdevice.h>
+ #include <brcmu_wifi.h>
--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c
@@ -15,8 +15,10 @@
#include <linux/kernel.h>
+#include <linux/printk.h>
- #include <linux/if_arp.h>
- #include <linux/sched.h>
- #include <linux/kthread.h>
+ #include <linux/etherdevice.h>
+ #include <net/cfg80211.h>
+ #include <net/netlink.h>
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -14,6 +14,7 @@