From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651AbcFNWK7 (ORCPT ); Tue, 14 Jun 2016 18:10:59 -0400 Received: from mail.savoirfairelinux.com ([208.88.110.44]:38864 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751998AbcFNWK5 (ORCPT ); Tue, 14 Jun 2016 18:10:57 -0400 From: Vivien Didelot To: Andrew Lunn Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli Subject: Re: [PATCH v2 net-next v2 09/12] net: dsa: mv88e6xxx: add SMI detection helper In-Reply-To: <20160614215034.GH12832@lunn.ch> References: <20160614183153.32327-1-vivien.didelot@savoirfairelinux.com> <20160614183153.32327-10-vivien.didelot@savoirfairelinux.com> <20160614215034.GH12832@lunn.ch> User-Agent: Notmuch/0.22 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) Date: Tue, 14 Jun 2016 18:10:53 -0400 Message-ID: <877fdr1kwi.fsf@ketchup.mtl.sfl> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, Andrew Lunn writes: >> - name = info->name; >> + dev_info(dev, "switch 0x%x detected: %s, revision %u\n", prod_num, >> + info->name, rev); >> >> - ps = devm_kzalloc(dsa_dev, sizeof(*ps), GFP_KERNEL); >> + ps = devm_kzalloc(dev, sizeof(*ps), GFP_KERNEL); >> if (!ps) >> return NULL; > > I don't like the way this detect function goes a lot further than > detection. I would say detection finished when you have the info > structure. Return at that point, and let the probe do the rest. OK, I split detection and allocation. Thanks, Vivien