From patchwork Mon Dec 20 21:29:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaston Gonzalez X-Patchwork-Id: 12696901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D606FC433F5 for ; Mon, 20 Dec 2021 21:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xrTr3aurBLb2aquAZ6Mr/jotuwNm5b1+I6dytBH3CH8=; b=MnPNOTlknHVevz wVzFAVpqtTjJtS2r5P1z9G+ojPi5exsi26+qP5yanIXdyXpPAPxefJN+xNzdC3k2UQfTKxZLkR3f7 AdxfKk9jtIjMv5jg9bUxVTtIJMZgzAmZu/n/kjXjM5ZFXY10Zma7PRa+hdcI+Q5FHmvsDlJ+cH5Xd bumcl34mE60tRU86XpyL3J8bC3ZDhuHXYzSj33booef1y19KYmyyN/aLXlQeWSf13aD+iw33OnfKX L81erEYICoEsI4wRa8IZs53asNqqkw7meOAlBhojAyOCiV4R2qnm1+Ta43/A+/FgFGIiR4bvd/R4Q DB9PV/2ULDUSOJmeJD8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzQFY-004UdH-E8; Mon, 20 Dec 2021 21:31:17 +0000 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzQFR-004Uac-Ii; Mon, 20 Dec 2021 21:31:11 +0000 Received: by mail-qv1-xf32.google.com with SMTP id kk22so10657198qvb.0; Mon, 20 Dec 2021 13:31:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XbS9uErZ5c4CCSbiHzp6Nqw9oW8CSOfv3JYeCjB7h/s=; b=ZV2zXZFTlYuITazlNNWKKFxASGrjAHJze0zJTlYdiCD8QL/zjDYWvNbY89WdPJUoIA 3xQzH1UtKZ/YIx6tIJu0P1FrudhMy2ldKE/xmX+EyXAmTBKmTxpwDwYlR22hue7Z2Mww 48be5SJ4bIqXnix7MHQcP7SJ/2Ief5l6Jzlai0SakgOPciszJfpca8I+76Wa8u+rsroT 1CMUKoIen4vDITSx6ohEk37N2tEbM+CA+GPvSpnOs3TN4JLirGOrDJ/DdEecSoN2KuIK TNYK4/xW++y9I5wgSK8tmgpfu8igpAJA2Vrhu6a4KtysUxkGT9g8rCrQ32teNyXw+GrX skwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XbS9uErZ5c4CCSbiHzp6Nqw9oW8CSOfv3JYeCjB7h/s=; b=NE8LrZn3oduRabLMkcItcF5rlYQaHyhtzKK0ixpTcSV7kgaZlEc9jrCCJqp7FZO3fa /fZ0oTCJbTdmzX5OKyQHR6xxTJzYtI3bmhuTIt9CpJMjJ/llaNbkHXc2TRXU5k6KxMfx 8kJeSHLeUB3ScwIpjN/GK8y825fzRwwJul7Bz0g+P00L9/Cq/d8OtGe60CExKtyzeOlt gjuFTAWSEgoxQChNlix7jVMTyKS7vVBRVa1/sEPdX0YGl04osxH7q5CSEqfpgIKgXUeT YRM94+Qvp+7GodkY4W5j2fHgOgZesAQD8JhXmIjPGTl33muTg4aESDSCqheAKLdDEyB2 2E9Q== X-Gm-Message-State: AOAM533l8glQ1vAsYyCoM7aFXe6QAR1L/VfbDN0mXiez1xbataWqrbNI iLP5aqeyrLlwUNTDNCWgyKA= X-Google-Smtp-Source: ABdhPJxKZCXLVtjy5SJQkGzGpUEqkJD9cq5OV6++SDXZLl1EbbJvmvvBInFUzc53pV55WkgBljI9Rg== X-Received: by 2002:a05:6214:20e9:: with SMTP id 9mr14767113qvk.28.1640035868201; Mon, 20 Dec 2021 13:31:08 -0800 (PST) Received: from localhost.localdomain ([181.23.83.92]) by smtp.gmail.com with ESMTPSA id s20sm16132210qtc.75.2021.12.20.13.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 13:31:07 -0800 (PST) From: Gaston Gonzalez To: linux-staging@lists.linux.dev Cc: gregkh@linuxfoundation.org, nsaenz@kernel.org, f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, juerg.haefliger@canonical.com, rdunlap@infradead.org, dave.stevenson@raspberrypi.com, stefan.wahren@i2se.com, unixbhaskar@gmail.com, mitaliborkar810@gmail.com, phil@raspberrypi.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, gascoar@gmail.com Subject: [PATCH 1/4] staging: vc04_services: avoid the use of typedef for function pointers Date: Mon, 20 Dec 2021 18:29:11 -0300 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211220_133109_644762_0E9F8E5C X-CRM114-Status: GOOD ( 12.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace typedefs bcm2835_audio_newpcm_func and bcm2835_audio_newctl_func with equivalent declarations to better align with the linux kernel coding style. As the '_func' in the function names is somehow reduntant, it was dropped in favour of the shorter names: 'bcm2835_audio_newpcm' and 'bcm2835_audio_newctl' Signed-off-by: Gaston Gonzalez --- .../vc04_services/bcm2835-audio/bcm2835.c | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c index c250fbef2fa3..412342d5b6c9 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c @@ -52,20 +52,14 @@ static int bcm2835_devm_add_vchi_ctx(struct device *dev) return 0; } -typedef int (*bcm2835_audio_newpcm_func)(struct bcm2835_chip *chip, - const char *name, - enum snd_bcm2835_route route, - u32 numchannels); - -typedef int (*bcm2835_audio_newctl_func)(struct bcm2835_chip *chip); - struct bcm2835_audio_driver { struct device_driver driver; const char *shortname; const char *longname; int minchannels; - bcm2835_audio_newpcm_func newpcm; - bcm2835_audio_newctl_func newctl; + int (*bcm2835_audio_newpcm)(struct bcm2835_chip *chip, const char *name, + enum snd_bcm2835_route route, u32 numchannels); + int (*bcm2835_audio_newctl)(struct bcm2835_chip *chip); enum snd_bcm2835_route route; }; @@ -104,8 +98,8 @@ static struct bcm2835_audio_driver bcm2835_audio_alsa = { .shortname = "bcm2835 ALSA", .longname = "bcm2835 ALSA", .minchannels = 2, - .newpcm = bcm2835_audio_alsa_newpcm, - .newctl = snd_bcm2835_new_ctl, + .bcm2835_audio_newpcm = bcm2835_audio_alsa_newpcm, + .bcm2835_audio_newctl = snd_bcm2835_new_ctl, }; static struct bcm2835_audio_driver bcm2835_audio_hdmi = { @@ -116,8 +110,8 @@ static struct bcm2835_audio_driver bcm2835_audio_hdmi = { .shortname = "bcm2835 HDMI", .longname = "bcm2835 HDMI", .minchannels = 1, - .newpcm = bcm2835_audio_simple_newpcm, - .newctl = snd_bcm2835_new_hdmi_ctl, + .bcm2835_audio_newpcm = bcm2835_audio_simple_newpcm, + .bcm2835_audio_newctl = snd_bcm2835_new_hdmi_ctl, .route = AUDIO_DEST_HDMI }; @@ -129,8 +123,8 @@ static struct bcm2835_audio_driver bcm2835_audio_headphones = { .shortname = "bcm2835 Headphones", .longname = "bcm2835 Headphones", .minchannels = 1, - .newpcm = bcm2835_audio_simple_newpcm, - .newctl = snd_bcm2835_new_headphones_ctl, + .bcm2835_audio_newpcm = bcm2835_audio_simple_newpcm, + .bcm2835_audio_newctl = snd_bcm2835_new_headphones_ctl, .route = AUDIO_DEST_HEADPHONES }; @@ -189,7 +183,7 @@ static int snd_add_child_device(struct device *dev, strscpy(card->shortname, audio_driver->shortname, sizeof(card->shortname)); strscpy(card->longname, audio_driver->longname, sizeof(card->longname)); - err = audio_driver->newpcm(chip, audio_driver->shortname, + err = audio_driver->bcm2835_audio_newpcm(chip, audio_driver->shortname, audio_driver->route, numchans); if (err) { @@ -197,7 +191,7 @@ static int snd_add_child_device(struct device *dev, goto error; } - err = audio_driver->newctl(chip); + err = audio_driver->bcm2835_audio_newctl(chip); if (err) { dev_err(dev, "Failed to create controls, error %d\n", err); goto error;