forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/pci/ac97/ac97_proc.c
....@@ -1,25 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
34 * Universal interface for Audio Codec '97
45 *
56 * For more details look to AC '97 component specification revision 2.2
67 * by Intel Corporation (http://developer.intel.com).
7
- *
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program; if not, write to the Free Software
21
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
- *
238 */
249
2510 #include <linux/mutex.h>
....@@ -436,25 +421,20 @@
436421 return;
437422 prefix = ac97_is_audio(ac97) ? "ac97" : "mc97";
438423 sprintf(name, "%s#%d-%d", prefix, ac97->addr, ac97->num);
439
- if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) {
424
+ entry = snd_info_create_card_entry(ac97->bus->card, name,
425
+ ac97->bus->proc);
426
+ if (entry)
440427 snd_info_set_text_ops(entry, ac97, snd_ac97_proc_read);
441
- if (snd_info_register(entry) < 0) {
442
- snd_info_free_entry(entry);
443
- entry = NULL;
444
- }
445
- }
446428 ac97->proc = entry;
447429 sprintf(name, "%s#%d-%d+regs", prefix, ac97->addr, ac97->num);
448
- if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) {
430
+ entry = snd_info_create_card_entry(ac97->bus->card, name,
431
+ ac97->bus->proc);
432
+ if (entry) {
449433 snd_info_set_text_ops(entry, ac97, snd_ac97_proc_regs_read);
450434 #ifdef CONFIG_SND_DEBUG
451435 entry->mode |= 0200;
452436 entry->c.text.write = snd_ac97_proc_regs_write;
453437 #endif
454
- if (snd_info_register(entry) < 0) {
455
- snd_info_free_entry(entry);
456
- entry = NULL;
457
- }
458438 }
459439 ac97->proc_regs = entry;
460440 }
....@@ -473,13 +453,10 @@
473453 char name[32];
474454
475455 sprintf(name, "codec97#%d", bus->num);
476
- if ((entry = snd_info_create_card_entry(bus->card, name, bus->card->proc_root)) != NULL) {
456
+ entry = snd_info_create_card_entry(bus->card, name,
457
+ bus->card->proc_root);
458
+ if (entry)
477459 entry->mode = S_IFDIR | 0555;
478
- if (snd_info_register(entry) < 0) {
479
- snd_info_free_entry(entry);
480
- entry = NULL;
481
- }
482
- }
483460 bus->proc = entry;
484461 }
485462