Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH 3/8] usb: typec: fusb302: Switch to device managed resources
Date: Fri, 13 Nov 2026 17:21:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-213293@kernel.org> (raw)
In-Reply-To: <20261113-fusb302-probe-cleanup-v1-3-e5c65a8c58c8@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] usb: typec: fusb302: build failure when CONFIG_DEBUG_FS is
  disabled
--

commit a5e9f3a79e68305810f439c482d64544f3449258
Author: Sebastian Reichel <sebastian.reichel@collabora.com>

usb: typec: fusb302: Switch to device managed resources

This commit converts fusb302_probe() and fusb302_remove() to use
device-managed resources for mutexes, workqueues, debugfs, fwnode, TCPM
port registration, work items, and interrupts.

> diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
> index 83bd287dadc7e..a7a1dce6cf86a 100644
> --- a/drivers/usb/typec/tcpm/fusb302.c
> +++ b/drivers/usb/typec/tcpm/fusb302.c
[ ... ]
> @@ -210,20 +211,28 @@ static int fusb302_debug_show(struct seq_file *s, void *v)
>  }
>  DEFINE_SHOW_ATTRIBUTE(fusb302_debug);
>  
> -static void fusb302_debugfs_init(struct fusb302_chip *chip)
> +static void fusb302_debugfs_exit(void *data)
> +{
> +	struct fusb302_chip *chip = data;
> +
> +	debugfs_remove(chip->dentry);
> +}
> +
> +static int fusb302_debugfs_init(struct fusb302_chip *chip)
>  {
>  	char name[NAME_MAX];
> +	int ret;
> +
> +	ret = devm_mutex_init(chip->dev, &chip->logbuffer_lock);
> +	if (ret < 0)
> +		return ret;
>  
> -	mutex_init(&chip->logbuffer_lock);
>  	snprintf(name, NAME_MAX, "fusb302-%s", dev_name(chip->dev));
>  	chip->dentry = debugfs_create_dir(name, usb_debug_root);
>  	debugfs_create_file("log", S_IFREG | 0444, chip->dentry, chip,
>  			    &fusb302_debug_fops);
> -}
>  
> -static void fusb302_debugfs_exit(struct fusb302_chip *chip)
> -{
> -	debugfs_remove(chip->dentry);
> +	return devm_add_action_or_reset(chip->dev, fusb302_debugfs_exit, chip);
>  }
>  
>  #else
>  
>  static void fusb302_log(const struct fusb302_chip *chip,
>  			const char *fmt, ...) { }
>  static void fusb302_debugfs_init(const struct fusb302_chip *chip) { }
> -static void fusb302_debugfs_exit(const struct fusb302_chip *chip) { }
>  
>  #endif

[Severity: High]
Does the !CONFIG_DEBUG_FS stub for fusb302_debugfs_init() also need to
return int (0)?  fusb302_probe() now assigns its return value to ret,
which fails to build when CONFIG_DEBUG_FS is disabled.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261113-fusb302-probe-cleanup-v1-0-e5c65a8c58c8@collabora.com?part=3

  reply	other threads:[~2026-11-13 17:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 16:42 [PATCH 0/8] usb: typec: fusb302: cleanup device driver probe Sebastian Reichel
2026-11-13 16:42 ` [PATCH 1/8] usb: typec: tcpm: allocate pd_list entries non device managed Sebastian Reichel
2026-11-13 16:55   ` sashiko-bot
2026-11-13 16:42 ` [PATCH 2/8] usb: typec: tcpm: add device managed port registration Sebastian Reichel
2026-11-13 17:06   ` sashiko-bot
2026-11-13 16:42 ` [PATCH 3/8] usb: typec: fusb302: Switch to device managed resources Sebastian Reichel
2026-11-13 17:21   ` sashiko-bot [this message]
2026-11-13 16:42 ` [PATCH 4/8] usb: typec: fusb302: switch to devm_pm_set_wake_irq Sebastian Reichel
2026-11-13 16:42 ` [PATCH 5/8] usb: typec: fusb302: rename init_gpio into fusb302_init_irq Sebastian Reichel
2026-11-13 16:42 ` [PATCH 6/8] usb: typec: fusb302: move gpio_int_n into function local scope Sebastian Reichel
2026-11-13 16:42 ` [PATCH 7/8] usb: typec: fusb302: rework gpio_int_n_irq handling Sebastian Reichel
2026-11-13 16:42 ` [PATCH 8/8] usb: typec: fusb302: drop custom gpio interrupt logic Sebastian Reichel

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=sashiko-outbox-213293@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sebastian.reichel@collabora.com \
    /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