diff options
-rw-r--r-- | drivers/gpu/nvgpu/pci.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/pci.c b/drivers/gpu/nvgpu/pci.c index bc8cb510..38a4ad10 100644 --- a/drivers/gpu/nvgpu/pci.c +++ b/drivers/gpu/nvgpu/pci.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "gk20a/gk20a.h" | 21 | #include "gk20a/gk20a.h" |
22 | #include "gk20a/platform_gk20a.h" | 22 | #include "gk20a/platform_gk20a.h" |
23 | 23 | ||
24 | #define PCI_INTERFACE_NAME "nvgpu-pci%s" | 24 | #define PCI_INTERFACE_NAME "nvgpu-pci-%s%%s" |
25 | 25 | ||
26 | static int nvgpu_pci_tegra_probe(struct device *dev) | 26 | static int nvgpu_pci_tegra_probe(struct device *dev) |
27 | { | 27 | { |
@@ -138,6 +138,7 @@ static int nvgpu_pci_probe(struct pci_dev *pdev, | |||
138 | struct gk20a_platform *platform = &nvgpu_pci_device; | 138 | struct gk20a_platform *platform = &nvgpu_pci_device; |
139 | struct gk20a *g; | 139 | struct gk20a *g; |
140 | int err; | 140 | int err; |
141 | char *nodefmt; | ||
141 | 142 | ||
142 | pci_set_drvdata(pdev, platform); | 143 | pci_set_drvdata(pdev, platform); |
143 | 144 | ||
@@ -174,7 +175,18 @@ static int nvgpu_pci_probe(struct pci_dev *pdev, | |||
174 | } | 175 | } |
175 | disable_irq(g->irq_stall); | 176 | disable_irq(g->irq_stall); |
176 | 177 | ||
177 | err = gk20a_user_init(&pdev->dev, PCI_INTERFACE_NAME); | 178 | if (strchr(dev_name(&pdev->dev), '%')) { |
179 | gk20a_err(&pdev->dev, "illegal character in device name"); | ||
180 | return -EINVAL; | ||
181 | } | ||
182 | |||
183 | nodefmt = kasprintf(GFP_KERNEL, PCI_INTERFACE_NAME, dev_name(&pdev->dev)); | ||
184 | if (!nodefmt) | ||
185 | return -ENOMEM; | ||
186 | |||
187 | err = gk20a_user_init(&pdev->dev, nodefmt); | ||
188 | kfree(nodefmt); | ||
189 | nodefmt = NULL; | ||
178 | if (err) | 190 | if (err) |
179 | return err; | 191 | return err; |
180 | 192 | ||