Re: [PATCH v7 1/2] power: supply: add Qualcomm PMI8998 SMB2 Charger driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I tried applying this, but it generates a compiler warning:

On Fri, Jan 27, 2023 at 11:05:05PM +0000, Caleb Connolly wrote:
> [...]
> +static int smb2_probe(struct platform_device *pdev)
> +{
> [...]
> +	desc->name = devm_kasprintf(chip->dev, GFP_KERNEL, "%s-charger",
> +				    device_get_match_data(chip->dev));

drivers/power/supply/qcom_pmi8998_charger.c: In function ‘smb2_probe’:
drivers/power/supply/qcom_pmi8998_charger.c:979:62: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘const void *’ [-Wformat=]
  979 |         desc->name = devm_kasprintf(chip->dev, GFP_KERNEL, "%s-charger",
      |                                                             ~^
      |                                                              |
      |                                                              char *
      |                                                             %p
  980 |                                     device_get_match_data(chip->dev));
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                     |
      |                                     const void *


Also while fixing this please also do the following change:

> +static int smb2_init_irq(struct smb2_chip *chip, int *irq, const char *name,
> +			 irqreturn_t (*handler)(int irq, void *data))
> +{
> +	int irqnum;
> +	int rc;
> +
> +	irqnum = of_irq_get_byname(chip->dev->of_node, name);

irqnum = platform_get_irq_byname(to_platform_device(chip->dev), name);

and drop <linux/of_irq.h> include.

> +	if (irqnum < 0)
> +		return dev_err_probe(chip->dev, irqnum,
> +				     "Couldn't get irq %s byname\n", name);
> +
> +	rc = devm_request_threaded_irq(chip->dev, irqnum, NULL, handler,
> +				       IRQF_ONESHOT, name, chip);
> +	if (rc < 0)
> +		return dev_err_probe(chip->dev, rc, "Couldn't request irq %s\n",
> +				     name);
> +
> +	if (irq)
> +		*irq = irqnum;
> +
> +	return 0;
> +}

Thanks,

-- Sebastian

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux