Skip to content

Commit 75c0a1b

Browse files
Tom Rixlag-linaro
authored andcommitted
mfd: twl-core: Remove unused add_child() and add_numbered_child() functions
Clang with W=1 reports: drivers/mfd/twl-core.c:654:30: error: unused function 'add_child' [-Werror,-Wunused-function] static inline struct device *add_child(unsigned mod_no, const char *name, ^ add_numbered_child() and its only caller add_child() are not used, so remove them. Signed-off-by: Tom Rix <trix@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230322115838.2569414-1-trix@redhat.com
1 parent 3e0475e commit 75c0a1b

1 file changed

Lines changed: 0 additions & 65 deletions

File tree

drivers/mfd/twl-core.c

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -594,71 +594,6 @@ int twl_get_hfclk_rate(void)
594594
}
595595
EXPORT_SYMBOL_GPL(twl_get_hfclk_rate);
596596

597-
static struct device *
598-
add_numbered_child(unsigned mod_no, const char *name, int num,
599-
void *pdata, unsigned pdata_len,
600-
bool can_wakeup, int irq0, int irq1)
601-
{
602-
struct platform_device *pdev;
603-
struct twl_client *twl;
604-
int status, sid;
605-
606-
if (unlikely(mod_no >= twl_get_last_module())) {
607-
pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no);
608-
return ERR_PTR(-EPERM);
609-
}
610-
sid = twl_priv->twl_map[mod_no].sid;
611-
twl = &twl_priv->twl_modules[sid];
612-
613-
pdev = platform_device_alloc(name, num);
614-
if (!pdev)
615-
return ERR_PTR(-ENOMEM);
616-
617-
pdev->dev.parent = &twl->client->dev;
618-
619-
if (pdata) {
620-
status = platform_device_add_data(pdev, pdata, pdata_len);
621-
if (status < 0) {
622-
dev_dbg(&pdev->dev, "can't add platform_data\n");
623-
goto put_device;
624-
}
625-
}
626-
627-
if (irq0) {
628-
struct resource r[2] = {
629-
{ .start = irq0, .flags = IORESOURCE_IRQ, },
630-
{ .start = irq1, .flags = IORESOURCE_IRQ, },
631-
};
632-
633-
status = platform_device_add_resources(pdev, r, irq1 ? 2 : 1);
634-
if (status < 0) {
635-
dev_dbg(&pdev->dev, "can't add irqs\n");
636-
goto put_device;
637-
}
638-
}
639-
640-
status = platform_device_add(pdev);
641-
if (status)
642-
goto put_device;
643-
644-
device_init_wakeup(&pdev->dev, can_wakeup);
645-
646-
return &pdev->dev;
647-
648-
put_device:
649-
platform_device_put(pdev);
650-
dev_err(&twl->client->dev, "failed to add device %s\n", name);
651-
return ERR_PTR(status);
652-
}
653-
654-
static inline struct device *add_child(unsigned mod_no, const char *name,
655-
void *pdata, unsigned pdata_len,
656-
bool can_wakeup, int irq0, int irq1)
657-
{
658-
return add_numbered_child(mod_no, name, -1, pdata, pdata_len,
659-
can_wakeup, irq0, irq1);
660-
}
661-
662597
/*----------------------------------------------------------------------*/
663598

664599
/*

0 commit comments

Comments
 (0)