Skip to content

Commit affec78

Browse files
committed
cxl/core: Convert to EXPORT_SYMBOL_NS_GPL
It turns out that the usb example of specifying the subsystem namespace at build time is not preferred. The rationale for that preference has become more apparent as CXL patches with plain EXPORT_SYMBOL_GPL beg the question, "why would any code other than CXL care about this symbol?". Make the namespace explicit. Reviewed-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/163676356810.3618264.601632777702192938.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <[email protected]>
1 parent 5e2411a commit affec78

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

drivers/cxl/core/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
obj-$(CONFIG_CXL_BUS) += cxl_core.o
33

4-
ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=CXL -I$(srctree)/drivers/cxl
4+
ccflags-y += -I$(srctree)/drivers/cxl
55
cxl_core-y := bus.o
66
cxl_core-y += pmem.o
77
cxl_core-y += regs.o

drivers/cxl/core/bus.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ bool is_root_decoder(struct device *dev)
200200
{
201201
return dev->type == &cxl_decoder_root_type;
202202
}
203-
EXPORT_SYMBOL_GPL(is_root_decoder);
203+
EXPORT_SYMBOL_NS_GPL(is_root_decoder, CXL);
204204

205205
struct cxl_decoder *to_cxl_decoder(struct device *dev)
206206
{
@@ -209,7 +209,7 @@ struct cxl_decoder *to_cxl_decoder(struct device *dev)
209209
return NULL;
210210
return container_of(dev, struct cxl_decoder, dev);
211211
}
212-
EXPORT_SYMBOL_GPL(to_cxl_decoder);
212+
EXPORT_SYMBOL_NS_GPL(to_cxl_decoder, CXL);
213213

214214
static void cxl_dport_release(struct cxl_dport *dport)
215215
{
@@ -376,7 +376,7 @@ struct cxl_port *devm_cxl_add_port(struct device *host, struct device *uport,
376376
put_device(dev);
377377
return ERR_PTR(rc);
378378
}
379-
EXPORT_SYMBOL_GPL(devm_cxl_add_port);
379+
EXPORT_SYMBOL_NS_GPL(devm_cxl_add_port, CXL);
380380

381381
static struct cxl_dport *find_dport(struct cxl_port *port, int id)
382382
{
@@ -451,7 +451,7 @@ int cxl_add_dport(struct cxl_port *port, struct device *dport_dev, int port_id,
451451
cxl_dport_release(dport);
452452
return rc;
453453
}
454-
EXPORT_SYMBOL_GPL(cxl_add_dport);
454+
EXPORT_SYMBOL_NS_GPL(cxl_add_dport, CXL);
455455

456456
static int decoder_populate_targets(struct cxl_decoder *cxld,
457457
struct cxl_port *port, int *target_map)
@@ -521,7 +521,7 @@ struct cxl_decoder *cxl_decoder_alloc(struct cxl_port *port, int nr_targets)
521521
kfree(cxld);
522522
return ERR_PTR(rc);
523523
}
524-
EXPORT_SYMBOL_GPL(cxl_decoder_alloc);
524+
EXPORT_SYMBOL_NS_GPL(cxl_decoder_alloc, CXL);
525525

526526
int cxl_decoder_add(struct cxl_decoder *cxld, int *target_map)
527527
{
@@ -550,7 +550,7 @@ int cxl_decoder_add(struct cxl_decoder *cxld, int *target_map)
550550

551551
return device_add(dev);
552552
}
553-
EXPORT_SYMBOL_GPL(cxl_decoder_add);
553+
EXPORT_SYMBOL_NS_GPL(cxl_decoder_add, CXL);
554554

555555
static void cxld_unregister(void *dev)
556556
{
@@ -561,7 +561,7 @@ int cxl_decoder_autoremove(struct device *host, struct cxl_decoder *cxld)
561561
{
562562
return devm_add_action_or_reset(host, cxld_unregister, &cxld->dev);
563563
}
564-
EXPORT_SYMBOL_GPL(cxl_decoder_autoremove);
564+
EXPORT_SYMBOL_NS_GPL(cxl_decoder_autoremove, CXL);
565565

566566
/**
567567
* __cxl_driver_register - register a driver for the cxl bus
@@ -594,13 +594,13 @@ int __cxl_driver_register(struct cxl_driver *cxl_drv, struct module *owner,
594594

595595
return driver_register(&cxl_drv->drv);
596596
}
597-
EXPORT_SYMBOL_GPL(__cxl_driver_register);
597+
EXPORT_SYMBOL_NS_GPL(__cxl_driver_register, CXL);
598598

599599
void cxl_driver_unregister(struct cxl_driver *cxl_drv)
600600
{
601601
driver_unregister(&cxl_drv->drv);
602602
}
603-
EXPORT_SYMBOL_GPL(cxl_driver_unregister);
603+
EXPORT_SYMBOL_NS_GPL(cxl_driver_unregister, CXL);
604604

605605
static int cxl_device_id(struct device *dev)
606606
{
@@ -642,7 +642,7 @@ struct bus_type cxl_bus_type = {
642642
.probe = cxl_bus_probe,
643643
.remove = cxl_bus_remove,
644644
};
645-
EXPORT_SYMBOL_GPL(cxl_bus_type);
645+
EXPORT_SYMBOL_NS_GPL(cxl_bus_type, CXL);
646646

647647
static __init int cxl_core_init(void)
648648
{

drivers/cxl/core/mbox.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ int cxl_mbox_send_cmd(struct cxl_dev_state *cxlds, u16 opcode, void *in,
182182

183183
return 0;
184184
}
185-
EXPORT_SYMBOL_GPL(cxl_mbox_send_cmd);
185+
EXPORT_SYMBOL_NS_GPL(cxl_mbox_send_cmd, CXL);
186186

187187
static bool cxl_mem_raw_command_allowed(u16 opcode)
188188
{
@@ -624,7 +624,7 @@ int cxl_enumerate_cmds(struct cxl_dev_state *cxlds)
624624
kvfree(gsl);
625625
return rc;
626626
}
627-
EXPORT_SYMBOL_GPL(cxl_enumerate_cmds);
627+
EXPORT_SYMBOL_NS_GPL(cxl_enumerate_cmds, CXL);
628628

629629
/**
630630
* cxl_mem_get_partition_info - Get partition info
@@ -709,7 +709,7 @@ int cxl_dev_state_identify(struct cxl_dev_state *cxlds)
709709

710710
return 0;
711711
}
712-
EXPORT_SYMBOL_GPL(cxl_dev_state_identify);
712+
EXPORT_SYMBOL_NS_GPL(cxl_dev_state_identify, CXL);
713713

714714
int cxl_mem_create_range_info(struct cxl_dev_state *cxlds)
715715
{
@@ -748,7 +748,7 @@ int cxl_mem_create_range_info(struct cxl_dev_state *cxlds)
748748

749749
return 0;
750750
}
751-
EXPORT_SYMBOL_GPL(cxl_mem_create_range_info);
751+
EXPORT_SYMBOL_NS_GPL(cxl_mem_create_range_info, CXL);
752752

753753
struct cxl_dev_state *cxl_dev_state_create(struct device *dev)
754754
{
@@ -765,7 +765,7 @@ struct cxl_dev_state *cxl_dev_state_create(struct device *dev)
765765

766766
return cxlds;
767767
}
768-
EXPORT_SYMBOL_GPL(cxl_dev_state_create);
768+
EXPORT_SYMBOL_NS_GPL(cxl_dev_state_create, CXL);
769769

770770
static struct dentry *cxl_debugfs;
771771

drivers/cxl/core/memdev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void set_exclusive_cxl_commands(struct cxl_dev_state *cxlds, unsigned long *cmds
150150
CXL_MEM_COMMAND_ID_MAX);
151151
up_write(&cxl_memdev_rwsem);
152152
}
153-
EXPORT_SYMBOL_GPL(set_exclusive_cxl_commands);
153+
EXPORT_SYMBOL_NS_GPL(set_exclusive_cxl_commands, CXL);
154154

155155
/**
156156
* clear_exclusive_cxl_commands() - atomically enable user cxl commands
@@ -164,7 +164,7 @@ void clear_exclusive_cxl_commands(struct cxl_dev_state *cxlds, unsigned long *cm
164164
CXL_MEM_COMMAND_ID_MAX);
165165
up_write(&cxl_memdev_rwsem);
166166
}
167-
EXPORT_SYMBOL_GPL(clear_exclusive_cxl_commands);
167+
EXPORT_SYMBOL_NS_GPL(clear_exclusive_cxl_commands, CXL);
168168

169169
static void cxl_memdev_shutdown(struct device *dev)
170170
{
@@ -317,7 +317,7 @@ struct cxl_memdev *devm_cxl_add_memdev(struct cxl_dev_state *cxlds)
317317
put_device(dev);
318318
return ERR_PTR(rc);
319319
}
320-
EXPORT_SYMBOL_GPL(devm_cxl_add_memdev);
320+
EXPORT_SYMBOL_NS_GPL(devm_cxl_add_memdev, CXL);
321321

322322
__init int cxl_memdev_init(void)
323323
{

drivers/cxl/core/pmem.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct cxl_nvdimm_bridge *to_cxl_nvdimm_bridge(struct device *dev)
4949
return NULL;
5050
return container_of(dev, struct cxl_nvdimm_bridge, dev);
5151
}
52-
EXPORT_SYMBOL_GPL(to_cxl_nvdimm_bridge);
52+
EXPORT_SYMBOL_NS_GPL(to_cxl_nvdimm_bridge, CXL);
5353

5454
__mock int match_nvdimm_bridge(struct device *dev, const void *data)
5555
{
@@ -65,7 +65,7 @@ struct cxl_nvdimm_bridge *cxl_find_nvdimm_bridge(struct cxl_nvdimm *cxl_nvd)
6565
return NULL;
6666
return to_cxl_nvdimm_bridge(dev);
6767
}
68-
EXPORT_SYMBOL_GPL(cxl_find_nvdimm_bridge);
68+
EXPORT_SYMBOL_NS_GPL(cxl_find_nvdimm_bridge, CXL);
6969

7070
static struct cxl_nvdimm_bridge *
7171
cxl_nvdimm_bridge_alloc(struct cxl_port *port)
@@ -167,7 +167,7 @@ struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
167167
put_device(dev);
168168
return ERR_PTR(rc);
169169
}
170-
EXPORT_SYMBOL_GPL(devm_cxl_add_nvdimm_bridge);
170+
EXPORT_SYMBOL_NS_GPL(devm_cxl_add_nvdimm_bridge, CXL);
171171

172172
static void cxl_nvdimm_release(struct device *dev)
173173
{
@@ -191,7 +191,7 @@ bool is_cxl_nvdimm(struct device *dev)
191191
{
192192
return dev->type == &cxl_nvdimm_type;
193193
}
194-
EXPORT_SYMBOL_GPL(is_cxl_nvdimm);
194+
EXPORT_SYMBOL_NS_GPL(is_cxl_nvdimm, CXL);
195195

196196
struct cxl_nvdimm *to_cxl_nvdimm(struct device *dev)
197197
{
@@ -200,7 +200,7 @@ struct cxl_nvdimm *to_cxl_nvdimm(struct device *dev)
200200
return NULL;
201201
return container_of(dev, struct cxl_nvdimm, dev);
202202
}
203-
EXPORT_SYMBOL_GPL(to_cxl_nvdimm);
203+
EXPORT_SYMBOL_NS_GPL(to_cxl_nvdimm, CXL);
204204

205205
static struct cxl_nvdimm *cxl_nvdimm_alloc(struct cxl_memdev *cxlmd)
206206
{
@@ -262,4 +262,4 @@ int devm_cxl_add_nvdimm(struct device *host, struct cxl_memdev *cxlmd)
262262
put_device(dev);
263263
return rc;
264264
}
265-
EXPORT_SYMBOL_GPL(devm_cxl_add_nvdimm);
265+
EXPORT_SYMBOL_NS_GPL(devm_cxl_add_nvdimm, CXL);

drivers/cxl/core/regs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void cxl_probe_component_regs(struct device *dev, void __iomem *base,
9090
}
9191
}
9292
}
93-
EXPORT_SYMBOL_GPL(cxl_probe_component_regs);
93+
EXPORT_SYMBOL_NS_GPL(cxl_probe_component_regs, CXL);
9494

9595
/**
9696
* cxl_probe_device_regs() - Detect CXL Device register blocks
@@ -156,7 +156,7 @@ void cxl_probe_device_regs(struct device *dev, void __iomem *base,
156156
}
157157
}
158158
}
159-
EXPORT_SYMBOL_GPL(cxl_probe_device_regs);
159+
EXPORT_SYMBOL_NS_GPL(cxl_probe_device_regs, CXL);
160160

161161
static void __iomem *devm_cxl_iomap_block(struct device *dev,
162162
resource_size_t addr,
@@ -199,7 +199,7 @@ int cxl_map_component_regs(struct pci_dev *pdev,
199199

200200
return 0;
201201
}
202-
EXPORT_SYMBOL_GPL(cxl_map_component_regs);
202+
EXPORT_SYMBOL_NS_GPL(cxl_map_component_regs, CXL);
203203

204204
int cxl_map_device_regs(struct pci_dev *pdev,
205205
struct cxl_device_regs *regs,
@@ -246,4 +246,4 @@ int cxl_map_device_regs(struct pci_dev *pdev,
246246

247247
return 0;
248248
}
249-
EXPORT_SYMBOL_GPL(cxl_map_device_regs);
249+
EXPORT_SYMBOL_NS_GPL(cxl_map_device_regs, CXL);

0 commit comments

Comments
 (0)