The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Cc: perex@perex.cz, tiwai@suse.de, linux-kernel@vger.kernel.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH] ALSA: Fix dynamic major number assignment
Date: Wed, 25 Nov 2026 08:41:28 +0100	[thread overview]
Message-ID: <87o6bd8ijb.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261125073009.3091-1-sreekuttan2156239@gmail.com>

On Wed, 25 Nov 2026 08:30:09 +0100,
Sreeraj S Kurup wrote:
> 
> When major is set to 0, register_chrdev() allocates
> a major number and returns it.
> 
> Store the allocated major number and update snd_major
> after successful registration.
> 
> This ensures ALSA uses the correct major number for
> device registration and unregistration.
> 
> Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>

We never thought of the dynamic major assignment there.
So major=0 should be treated simply as an error before passing to
register_chrdev().

Moreover, the current code was written before module_param_named() is
used widely, and that's why it has unnecessary assignments.
That is, we can drop major and cards_limit variables, and directly use
snd_major and snd_ecards_limit with initialization and
module_param_named().


thanks,

Takashi

      reply	other threads:[~2026-11-25  7:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  7:30 [PATCH] ALSA: Fix dynamic major number assignment Sreeraj S Kurup
2026-11-25  7:41 ` Takashi Iwai [this message]

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=87o6bd8ijb.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=sreekuttan2156239@gmail.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