| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> |
|---|
| 3 | 4 | * Universal interface for Audio Codec '97 |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * For more details look to AC '97 component specification revision 2.2 |
|---|
| 6 | 7 | * 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 | | - * |
|---|
| 23 | 8 | */ |
|---|
| 24 | 9 | |
|---|
| 25 | 10 | #include <linux/mutex.h> |
|---|
| .. | .. |
|---|
| 436 | 421 | return; |
|---|
| 437 | 422 | prefix = ac97_is_audio(ac97) ? "ac97" : "mc97"; |
|---|
| 438 | 423 | 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) |
|---|
| 440 | 427 | 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 | | - } |
|---|
| 446 | 428 | ac97->proc = entry; |
|---|
| 447 | 429 | 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) { |
|---|
| 449 | 433 | snd_info_set_text_ops(entry, ac97, snd_ac97_proc_regs_read); |
|---|
| 450 | 434 | #ifdef CONFIG_SND_DEBUG |
|---|
| 451 | 435 | entry->mode |= 0200; |
|---|
| 452 | 436 | entry->c.text.write = snd_ac97_proc_regs_write; |
|---|
| 453 | 437 | #endif |
|---|
| 454 | | - if (snd_info_register(entry) < 0) { |
|---|
| 455 | | - snd_info_free_entry(entry); |
|---|
| 456 | | - entry = NULL; |
|---|
| 457 | | - } |
|---|
| 458 | 438 | } |
|---|
| 459 | 439 | ac97->proc_regs = entry; |
|---|
| 460 | 440 | } |
|---|
| .. | .. |
|---|
| 473 | 453 | char name[32]; |
|---|
| 474 | 454 | |
|---|
| 475 | 455 | 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) |
|---|
| 477 | 459 | entry->mode = S_IFDIR | 0555; |
|---|
| 478 | | - if (snd_info_register(entry) < 0) { |
|---|
| 479 | | - snd_info_free_entry(entry); |
|---|
| 480 | | - entry = NULL; |
|---|
| 481 | | - } |
|---|
| 482 | | - } |
|---|
| 483 | 460 | bus->proc = entry; |
|---|
| 484 | 461 | } |
|---|
| 485 | 462 | |
|---|