Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp9025237ybc; Fri, 29 Nov 2019 22:56:50 -0800 (PST) X-Google-Smtp-Source: APXvYqwoSBK5vlUeZJ14GJ47XqBH4dyeGZpWSWW4bYdGS97N8u+C4uAGqE0mzonAhrHbVv26FK6Q X-Received: by 2002:a17:906:b2c7:: with SMTP id cf7mr64039859ejb.218.1575097010831; Fri, 29 Nov 2019 22:56:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575097010; cv=none; d=google.com; s=arc-20160816; b=UmSd1PNR83f/cecfCmSq/XeroCe30ZEWc1gcjs4wMAU3Kh1GVhLDVtPzPqj6JZ41H+ YkJXhu/adCfwSy5jYW9rx+HMq1cPBJ5Hq/QKWY6ix/Jo3Rp5JE62/Dsax5tFOT8zJpxC O34pKNKxiITLjhHrCP9/oidhGVZxolpFSGHrtVdDr+zZOV6RbyZ6r5aXASykx+X/Wf7x peVtOkF54HDIHVzuxLMSaVtyFdpo0L9VV+x5Cn/JfHqYlMt2HxstfY0hWh3KQDpbbCdC YenCcOmOtXWdY+oQ7nIDfCGWYhl0MHFUsavfNOc6Xe8S3skggRSho+5mkBX1PxtM/dBn rz1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=jkdoSYUNZ89xuj/Bwl89piFhc4gKd3WFY89atXxPidA=; b=wTwNR5Vkd6xrxAjd75JlDgT13hHxzoCbfPn7Fql2p5wmY460/qUZlRnSM8cFh4PidI gNU2M7fpAX8BLnIw9Yw2efxh6qwtVjZ6sjN4FeWn7vSVVXyNbuoaeNVGTyqlQDCLEuZX 35yR0KjFNw8SG/JJnndJvStrsmfrohBPmhL8RMchQdrJq4sposmujUCMAOjWeL3S4awx UHlhg13P6QNcTK61Z3Y7knbsn4XCWGpJLKrtL7lFMtDtQZu35KkBwBcewmi1hiHZLVTC UqUfKgiF7qMgI/2Lr5oEWj2b4S9ZDEK6eR/5uYhOapvNNYDDTpS84Msgma6+9VWj4PY8 q4IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=oPISDPzG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q23si16412257ejn.236.2019.11.29.22.56.27; Fri, 29 Nov 2019 22:56:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=oPISDPzG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726799AbfK3GyX (ORCPT + 99 others); Sat, 30 Nov 2019 01:54:23 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:42992 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbfK3GyX (ORCPT ); Sat, 30 Nov 2019 01:54:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jkdoSYUNZ89xuj/Bwl89piFhc4gKd3WFY89atXxPidA=; b=oPISDPzGcYsw9AyQhiH0DhPeQ wZRlwujwV0gRp91PwLMfvIR2hDQpz7FU1K7oYPm5M3QyoLey9TqviBS5Uw/fbuwcvctTWodNSMnZ/ K07ExbsBkEugHn0wGVlICpFQHi4Wh3KP+uH+3XcS+zhab8Zx3Zi0tchwbDXLUjGPmJqIlVu+qEC1I f3wzGHr+DVckAvU3q9GxMazc4Pw0IpOMMiMAxEbWIkkiVdvYY7C+5d/v4IxEDVMP9jr7O+VDxRkqV 5/MWMtBv7S4smCEbO2cmDttYGSoNs5VibUZfefy12B7YZSFnjLQTbkD0AsdZruXd7tKf56Rgj2MUU pMz9f/2Jw==; Received: from [80.156.29.194] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iawe2-0002Ec-Rk; Sat, 30 Nov 2019 06:54:19 +0000 Date: Sat, 30 Nov 2019 07:54:15 +0100 From: Mauro Carvalho Chehab To: "Daniel W. S. Almeida" Cc: gregkh@linuxfoundation.org, rfontana@redhat.com, kstewart@linuxfoundation.org, tglx@linutronix.de, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: dvb_dummy_fe: Add error messages in case of attach failure Message-ID: <20191130075415.5d7ac0b1@kernel.org> In-Reply-To: <20191107013745.22147-1-dwlsalmeida@gmail.com> References: <20191107013745.22147-1-dwlsalmeida@gmail.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, 6 Nov 2019 22:37:45 -0300 "Daniel W. S. Almeida" escreveu: > From: "Daniel W. S. Almeida" > > Complain if the attach functions fail, for any reason. This is helpful > when debugging. > > Suggested-by: Shuah Khan > Signed-off-by: Daniel W. S. Almeida Looks OK to me. > --- > drivers/media/dvb-frontends/dvb_dummy_fe.c | 18 +++++++++++++++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c > index 4db679cb70ad..ca86857c3667 100644 > --- a/drivers/media/dvb-frontends/dvb_dummy_fe.c > +++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c > @@ -114,12 +114,16 @@ struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void) > /* allocate memory for the internal state */ > state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); > if (!state) > - return NULL; > + goto err; > > /* create dvb_frontend */ > memcpy(&state->frontend.ops, &dvb_dummy_fe_ofdm_ops, sizeof(struct dvb_frontend_ops)); > state->frontend.demodulator_priv = state; > return &state->frontend; > + > +err: > + pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__); > + return NULL; > } > > static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops; > @@ -131,12 +135,16 @@ struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void) > /* allocate memory for the internal state */ > state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); > if (!state) > - return NULL; > + goto err; > > /* create dvb_frontend */ > memcpy(&state->frontend.ops, &dvb_dummy_fe_qpsk_ops, sizeof(struct dvb_frontend_ops)); > state->frontend.demodulator_priv = state; > return &state->frontend; > + > +err: > + pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__); > + return NULL; > } > > static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops; > @@ -148,12 +156,16 @@ struct dvb_frontend *dvb_dummy_fe_qam_attach(void) > /* allocate memory for the internal state */ > state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); > if (!state) > - return NULL; > + goto err; > > /* create dvb_frontend */ > memcpy(&state->frontend.ops, &dvb_dummy_fe_qam_ops, sizeof(struct dvb_frontend_ops)); > state->frontend.demodulator_priv = state; > return &state->frontend; > + > +err: > + pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__); > + return NULL; > } > > static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = { Cheers, Mauro