linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-gpio@vger.kernel.org
Subject: [linusw-gpio:b4/gpio-descriptors-sound-misc 5/5] sound/soc/tegra/tegra20_ac97.c:46:33: warning: passing argument 1 of 'gpiod_set_value' makes pointer from integer without a cast
Date: Wed, 13 Dec 2023 07:33:09 +0800	[thread overview]
Message-ID: <202312130748.S0Z3yEtT-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git b4/gpio-descriptors-sound-misc
head:   cbde31b95f12d0b3059938194b704f40cdd55540
commit: cbde31b95f12d0b3059938194b704f40cdd55540 [5/5] ASoC: tegra: tegra20_ac97: Convert to use GPIO descriptors
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20231213/202312130748.S0Z3yEtT-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231213/202312130748.S0Z3yEtT-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312130748.S0Z3yEtT-lkp@intel.com/

All warnings (new ones prefixed by >>):

   sound/soc/tegra/tegra20_ac97.c: In function 'tegra20_ac97_codec_reset':
>> sound/soc/tegra/tegra20_ac97.c:46:33: warning: passing argument 1 of 'gpiod_set_value' makes pointer from integer without a cast [-Wint-conversion]
      46 |         gpiod_set_value(workdata->reset_gpio, 1);
         |                         ~~~~~~~~^~~~~~~~~~~~
         |                                 |
         |                                 int
   In file included from sound/soc/tegra/tegra20_ac97.c:15:
   include/linux/gpio/consumer.h:122:40: note: expected 'struct gpio_desc *' but argument is of type 'int'
     122 | void gpiod_set_value(struct gpio_desc *desc, int value);
         |                      ~~~~~~~~~~~~~~~~~~^~~~
   sound/soc/tegra/tegra20_ac97.c:49:33: warning: passing argument 1 of 'gpiod_set_value' makes pointer from integer without a cast [-Wint-conversion]
      49 |         gpiod_set_value(workdata->reset_gpio, 0);
         |                         ~~~~~~~~^~~~~~~~~~~~
         |                                 |
         |                                 int
   include/linux/gpio/consumer.h:122:40: note: expected 'struct gpio_desc *' but argument is of type 'int'
     122 | void gpiod_set_value(struct gpio_desc *desc, int value);
         |                      ~~~~~~~~~~~~~~~~~~^~~~
   sound/soc/tegra/tegra20_ac97.c: In function 'tegra20_ac97_codec_warm_reset':
>> sound/soc/tegra/tegra20_ac97.c:72:40: warning: passing argument 1 of 'gpiod_direction_output' makes pointer from integer without a cast [-Wint-conversion]
      72 |         gpiod_direction_output(workdata->sync_gpio, 1);
         |                                ~~~~~~~~^~~~~~~~~~~
         |                                        |
         |                                        int
   include/linux/gpio/consumer.h:111:46: note: expected 'struct gpio_desc *' but argument is of type 'int'
     111 | int gpiod_direction_output(struct gpio_desc *desc, int value);
         |                            ~~~~~~~~~~~~~~~~~~^~~~
   sound/soc/tegra/tegra20_ac97.c:74:33: warning: passing argument 1 of 'gpiod_set_value' makes pointer from integer without a cast [-Wint-conversion]
      74 |         gpiod_set_value(workdata->sync_gpio, 0);
         |                         ~~~~~~~~^~~~~~~~~~~
         |                                 |
         |                                 int
   include/linux/gpio/consumer.h:122:40: note: expected 'struct gpio_desc *' but argument is of type 'int'
     122 | void gpiod_set_value(struct gpio_desc *desc, int value);
         |                      ~~~~~~~~~~~~~~~~~~^~~~
   sound/soc/tegra/tegra20_ac97.c: In function 'tegra20_ac97_platform_probe':
>> sound/soc/tegra/tegra20_ac97.c:345:26: warning: assignment to 'int' from 'struct gpio_desc *' makes integer from pointer without a cast [-Wint-conversion]
     345 |         ac97->reset_gpio = devm_gpiod_get(&pdev->dev,
         |                          ^
>> sound/soc/tegra/tegra20_ac97.c:348:24: warning: passing argument 1 of 'IS_ERR' makes pointer from integer without a cast [-Wint-conversion]
     348 |         if (IS_ERR(ac97->reset_gpio)) {
         |                    ~~~~^~~~~~~~~~~~
         |                        |
         |                        int
   In file included from include/linux/clk.h:12,
                    from sound/soc/tegra/tegra20_ac97.c:12:
   include/linux/err.h:59:60: note: expected 'const void *' but argument is of type 'int'
      59 | static inline bool __must_check IS_ERR(__force const void *ptr)
         |                                                ~~~~~~~~~~~~^~~
>> sound/soc/tegra/tegra20_ac97.c:349:35: warning: passing argument 1 of 'PTR_ERR' makes pointer from integer without a cast [-Wint-conversion]
     349 |                 ret = PTR_ERR(ac97->reset_gpio);
         |                               ~~~~^~~~~~~~~~~~
         |                                   |
         |                                   int
   include/linux/err.h:49:61: note: expected 'const void *' but argument is of type 'int'
      49 | static inline long __must_check PTR_ERR(__force const void *ptr)
         |                                                 ~~~~~~~~~~~~^~~
>> sound/soc/tegra/tegra20_ac97.c:353:37: warning: passing argument 1 of 'gpiod_set_consumer_name' makes pointer from integer without a cast [-Wint-conversion]
     353 |         gpiod_set_consumer_name(ac97->reset_gpio, "codec-reset");
         |                                 ~~~~^~~~~~~~~~~~
         |                                     |
         |                                     int
   include/linux/gpio/consumer.h:168:47: note: expected 'struct gpio_desc *' but argument is of type 'int'
     168 | int gpiod_set_consumer_name(struct gpio_desc *desc, const char *name);
         |                             ~~~~~~~~~~~~~~~~~~^~~~
   sound/soc/tegra/tegra20_ac97.c:355:25: warning: assignment to 'int' from 'struct gpio_desc *' makes integer from pointer without a cast [-Wint-conversion]
     355 |         ac97->sync_gpio = devm_gpiod_get(&pdev->dev,
         |                         ^
   sound/soc/tegra/tegra20_ac97.c:358:24: warning: passing argument 1 of 'IS_ERR' makes pointer from integer without a cast [-Wint-conversion]
     358 |         if (IS_ERR(ac97->sync_gpio)) {
         |                    ~~~~^~~~~~~~~~~
         |                        |
         |                        int
   include/linux/err.h:59:60: note: expected 'const void *' but argument is of type 'int'
      59 | static inline bool __must_check IS_ERR(__force const void *ptr)
         |                                                ~~~~~~~~~~~~^~~
   sound/soc/tegra/tegra20_ac97.c:359:35: warning: passing argument 1 of 'PTR_ERR' makes pointer from integer without a cast [-Wint-conversion]
     359 |                 ret = PTR_ERR(ac97->sync_gpio);
         |                               ~~~~^~~~~~~~~~~
         |                                   |
         |                                   int
   include/linux/err.h:49:61: note: expected 'const void *' but argument is of type 'int'
      49 | static inline long __must_check PTR_ERR(__force const void *ptr)
         |                                                 ~~~~~~~~~~~~^~~
   sound/soc/tegra/tegra20_ac97.c:363:37: warning: passing argument 1 of 'gpiod_set_consumer_name' makes pointer from integer without a cast [-Wint-conversion]
     363 |         gpiod_set_consumer_name(ac97->sync_gpio, "codec-sync");
         |                                 ~~~~^~~~~~~~~~~
         |                                     |
         |                                     int
   include/linux/gpio/consumer.h:168:47: note: expected 'struct gpio_desc *' but argument is of type 'int'
     168 | int gpiod_set_consumer_name(struct gpio_desc *desc, const char *name);
         |                             ~~~~~~~~~~~~~~~~~~^~~~


vim +/gpiod_set_value +46 sound/soc/tegra/tegra20_ac97.c

    35	
    36	static void tegra20_ac97_codec_reset(struct snd_ac97 *ac97)
    37	{
    38		u32 readback;
    39		unsigned long timeout;
    40	
    41		/*
    42		 * The reset line is not driven by DAC pad group, have to toggle GPIO.
    43		 * The RESET line is active low but this is abstracted by the GPIO
    44		 * library.
    45		 */
  > 46		gpiod_set_value(workdata->reset_gpio, 1);
    47		udelay(2);
    48	
    49		gpiod_set_value(workdata->reset_gpio, 0);
    50		udelay(2);
    51	
    52		timeout = jiffies + msecs_to_jiffies(100);
    53	
    54		do {
    55			regmap_read(workdata->regmap, TEGRA20_AC97_STATUS1, &readback);
    56			if (readback & TEGRA20_AC97_STATUS1_CODEC1_RDY)
    57				break;
    58			usleep_range(1000, 2000);
    59		} while (!time_after(jiffies, timeout));
    60	}
    61	
    62	static void tegra20_ac97_codec_warm_reset(struct snd_ac97 *ac97)
    63	{
    64		u32 readback;
    65		unsigned long timeout;
    66	
    67		/*
    68		 * although sync line is driven by the DAC pad group warm reset using
    69		 * the controller cmd is not working, have to toggle sync line
    70		 * manually.
    71		 */
  > 72		gpiod_direction_output(workdata->sync_gpio, 1);
    73		udelay(2);
    74		gpiod_set_value(workdata->sync_gpio, 0);
    75		udelay(2);
    76	
    77		timeout = jiffies + msecs_to_jiffies(100);
    78	
    79		do {
    80			regmap_read(workdata->regmap, TEGRA20_AC97_STATUS1, &readback);
    81			if (readback & TEGRA20_AC97_STATUS1_CODEC1_RDY)
    82				break;
    83			usleep_range(1000, 2000);
    84		} while (!time_after(jiffies, timeout));
    85	}
    86	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2023-12-12 23:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202312130748.S0Z3yEtT-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).