Skip to content

Commit ce6d73c

Browse files
Uwe Kleine-Königmpe
authored andcommitted
powerpc: make of_device_ids const
of_device_ids (i.e. compatible strings and the respective data) are not supposed to change at runtime. All functions working with of_device_ids provided by <linux/of.h> work with const of_device_ids. This allows to mark all struct of_device_id const, too. While touching these line also put the __init annotation at the right position where necessary. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent d4fe096 commit ce6d73c

58 files changed

Lines changed: 67 additions & 67 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/powerpc/kernel/ibmebus.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static struct device ibmebus_bus_device = { /* fake "parent" device */
5555
struct bus_type ibmebus_bus_type;
5656

5757
/* These devices will automatically be added to the bus during init */
58-
static struct of_device_id __initdata ibmebus_matches[] = {
58+
static const struct of_device_id ibmebus_matches[] __initconst = {
5959
{ .compatible = "IBM,lhca" },
6060
{ .compatible = "IBM,lhea" },
6161
{},

‎arch/powerpc/kernel/legacy_serial.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static struct legacy_serial_info {
3535
phys_addr_t taddr;
3636
} legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS];
3737

38-
static struct of_device_id legacy_serial_parents[] __initdata = {
38+
static const struct of_device_id legacy_serial_parents[] __initconst = {
3939
{.type = "soc",},
4040
{.type = "tsi-bridge",},
4141
{.type = "opb", },

‎arch/powerpc/kernel/of_platform.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static int of_pci_phb_probe(struct platform_device *dev)
9797
return 0;
9898
}
9999

100-
static struct of_device_id of_pci_phb_ids[] = {
100+
static const struct of_device_id of_pci_phb_ids[] = {
101101
{ .type = "pci", },
102102
{ .type = "pcix", },
103103
{ .type = "pcie", },

‎arch/powerpc/platforms/40x/ep405.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static void __iomem *bcsr_regs;
4949
/* there's more, can't be bothered typing them tho */
5050

5151

52-
static __initdata struct of_device_id ep405_of_bus[] = {
52+
static const struct of_device_id ep405_of_bus[] __initconst = {
5353
{ .compatible = "ibm,plb3", },
5454
{ .compatible = "ibm,opb", },
5555
{ .compatible = "ibm,ebc", },

‎arch/powerpc/platforms/40x/ppc40x_simple.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <linux/init.h>
2525
#include <linux/of_platform.h>
2626

27-
static __initdata struct of_device_id ppc40x_of_bus[] = {
27+
static const struct of_device_id ppc40x_of_bus[] __initconst = {
2828
{ .compatible = "ibm,plb3", },
2929
{ .compatible = "ibm,plb4", },
3030
{ .compatible = "ibm,opb", },

‎arch/powerpc/platforms/40x/virtex.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <asm/xilinx_pci.h>
1818
#include <asm/ppc4xx.h>
1919

20-
static struct of_device_id xilinx_of_bus_ids[] __initdata = {
20+
static const struct of_device_id xilinx_of_bus_ids[] __initconst = {
2121
{ .compatible = "xlnx,plb-v46-1.00.a", },
2222
{ .compatible = "xlnx,plb-v34-1.01.a", },
2323
{ .compatible = "xlnx,plb-v34-1.02.a", },

‎arch/powerpc/platforms/40x/walnut.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <asm/pci-bridge.h>
2929
#include <asm/ppc4xx.h>
3030

31-
static __initdata struct of_device_id walnut_of_bus[] = {
31+
static const struct of_device_id walnut_of_bus[] __initconst = {
3232
{ .compatible = "ibm,plb3", },
3333
{ .compatible = "ibm,opb", },
3434
{ .compatible = "ibm,ebc", },

‎arch/powerpc/platforms/44x/canyonlands.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#define BCSR_USB_EN 0x11
3535

36-
static __initdata struct of_device_id ppc460ex_of_bus[] = {
36+
static const struct of_device_id ppc460ex_of_bus[] __initconst = {
3737
{ .compatible = "ibm,plb4", },
3838
{ .compatible = "ibm,opb", },
3939
{ .compatible = "ibm,ebc", },

‎arch/powerpc/platforms/44x/ebony.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <asm/pci-bridge.h>
2929
#include <asm/ppc4xx.h>
3030

31-
static __initdata struct of_device_id ebony_of_bus[] = {
31+
static const struct of_device_id ebony_of_bus[] __initconst = {
3232
{ .compatible = "ibm,plb4", },
3333
{ .compatible = "ibm,opb", },
3434
{ .compatible = "ibm,ebc", },

‎arch/powerpc/platforms/44x/iss4xx.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <asm/mpic.h>
3333
#include <asm/mmu.h>
3434

35-
static __initdata struct of_device_id iss4xx_of_bus[] = {
35+
static const struct of_device_id iss4xx_of_bus[] __initconst = {
3636
{ .compatible = "ibm,plb4", },
3737
{ .compatible = "ibm,plb6", },
3838
{ .compatible = "ibm,opb", },

0 commit comments

Comments
 (0)